import { jsx, jsxs } from "react/jsx-runtime";
import { Text } from "ink";
import { useAnimationTick } from "../../hooks/useAnimationTick.js";
import { BRAILLE_SPINNER_FRAMES } from "../../constants/spinnerFrames.js";
function ToolIcon({ status, isError }) {
  const tick = useAnimationTick({ enabled: status === "running", intervalMs: 80 });
  const frame = tick % BRAILLE_SPINNER_FRAMES.length;
  if (status === "pending") {
    return /* @__PURE__ */ jsx(Text, { color: "gray", children: "\u25CF " });
  }
  if (status === "pending_approval") {
    return /* @__PURE__ */ jsxs(Text, { color: "yellowBright", bold: true, children: [
      "\u25CF",
      " "
    ] });
  }
  if (status === "finished") {
    if (isError) {
      return /* @__PURE__ */ jsxs(Text, { color: "red", bold: true, children: [
        "\u25CF",
        " "
      ] });
    }
    return /* @__PURE__ */ jsxs(Text, { color: "green", bold: true, children: [
      "\u25CF",
      " "
    ] });
  }
  return /* @__PURE__ */ jsxs(Text, { color: "green", bold: true, children: [
    BRAILLE_SPINNER_FRAMES[frame],
    " "
  ] });
}
export {
  ToolIcon
};
