"use client";
import { composeRefs } from "../../utils/compose-refs.js";
import { ark } from "../factory.js";
import { useSwapContext } from "./use-swap-context.js";
import { forwardRef } from "react";
import { mergeProps } from "@zag-js/react";
import { jsx } from "react/jsx-runtime";
//#region src/components/swap/swap-indicator.tsx
var SwapIndicator = forwardRef((props, ref) => {
	const { type, ...restProps } = props;
	const swap = useSwapContext();
	const presence = type === "on" ? swap.onPresence : swap.offPresence;
	if (presence.unmounted) return null;
	const mergedProps = mergeProps(swap.getIndicatorProps({ type }), restProps);
	return /* @__PURE__ */ jsx(ark.span, {
		...mergedProps,
		ref: composeRefs(presence.ref, ref)
	});
});
SwapIndicator.displayName = "SwapIndicator";
//#endregion
export { SwapIndicator };
