import { c as _c } from "react/compiler-runtime";
import React from 'react';
import { BLACK_CIRCLE } from '../constants/figures.js';
import { useBlink } from '../hooks/useBlink.js';
import { Box, Text } from '../ink.js';
type Props = {
  isError: boolean;
  isUnresolved: boolean;
  shouldAnimate: boolean;
};
export function ToolUseLoader(t0) {
  const $ = _c(7);
  const {
    isError,
    isUnresolved,
    shouldAnimate
  } = t0;
  const [ref, isBlinking] = useBlink(shouldAnimate);
  const color = isUnresolved ? undefined : isError ? "error" : "success";
  const t1 = !shouldAnimate || isBlinking || isError || !isUnresolved ? BLACK_CIRCLE : " ";
  let t2;
  if ($[0] !== color || $[1] !== isUnresolved || $[2] !== t1) {
    t2 = <Text color={color} dimColor={isUnresolved}>{t1}</Text>;
    $[0] = color;
    $[1] = isUnresolved;
    $[2] = t1;
    $[3] = t2;
  } else {
    t2 = $[3];
  }
  let t3;
  if ($[4] !== ref || $[5] !== t2) {
    t3 = <Box ref={ref} minWidth={2}>{t2}</Box>;
    $[4] = ref;
    $[5] = t2;
    $[6] = t3;
  } else {
    t3 = $[6];
  }
  return t3;
}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJSZWFjdCIsIkJMQUNLX0NJUkNMRSIsInVzZUJsaW5rIiwiQm94IiwiVGV4dCIsIlByb3BzIiwiaXNFcnJvciIsImlzVW5yZXNvbHZlZCIsInNob3VsZEFuaW1hdGUiLCJUb29sVXNlTG9hZGVyIiwidDAiLCIkIiwiX2MiLCJyZWYiLCJpc0JsaW5raW5nIiwiY29sb3IiLCJ1bmRlZmluZWQiLCJ0MSIsInQyIiwidDMiXSwic291cmNlcyI6WyJUb29sVXNlTG9hZGVyLnRzeCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnXG5pbXBvcnQgeyBCTEFDS19DSVJDTEUgfSBmcm9tICcuLi9jb25zdGFudHMvZmlndXJlcy5qcydcbmltcG9ydCB7IHVzZ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