import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
import React from "react";
import { Text, Box } from "ink";
import { useTheme } from "../theme/theme.js";
import { useBlink } from "../hooks/useBlink.js";
import { BLACK_CIRCLE } from "../constants/figures.js";
/**
 * Status dot indicator for tool executions.
 *
 * Matches claude-code's ToolUseLoader:
 * - running: blinking dot (dimColor, primary), or solid when staticDisplay is true
 * - done:    solid green dot
 * - error:   solid red dot
 * - queued:  solid dim dot
 *
 * All running instances blink in sync via the shared animation clock.
 * Fixed `minWidth={2}` ensures alignment when the dot blinks off.
 */
export function ToolUseLoader({ status, staticDisplay = false, color: colorOverride, }) {
    const theme = useTheme();
    const isVisible = useBlink(status === "running" && !staticDisplay);
    let color;
    let dimColor = false;
    switch (status) {
        case "running":
            color = theme.primary;
            dimColor = true;
            break;
        case "done":
            color = theme.success;
            break;
        case "error":
            color = theme.error;
            break;
        case "queued":
            color = theme.textDim;
            dimColor = true;
            break;
    }
    return (_jsx(Box, { minWidth: 2, flexShrink: 0, children: _jsxs(Text, { color: colorOverride ?? color, dimColor: colorOverride ? false : dimColor, children: [isVisible ? BLACK_CIRCLE : " ", " "] }) }));
}
//# sourceMappingURL=ToolUseLoader.js.map