import { jsx } from "react/jsx-runtime";
import { Text } from "ink";
import { useEffect, useState } from "react";
import { spinner } from "../theme/motion.js";
import { reducedMotion } from "../theme/motion-guard.js";
function Spinner() {
  const rm = reducedMotion();
  const [i, setI] = useState(0);
  useEffect(() => {
    if (rm) return;
    const t = setInterval(() => setI((x) => (x + 1) % spinner.dots.length), 80);
    return () => clearInterval(t);
  }, [rm]);
  return /* @__PURE__ */ jsx(Text, { children: rm ? "\u2026" : spinner.dots[i] });
}
export {
  Spinner
};
//# sourceMappingURL=Spinner.js.map