import { jsx as _jsx } from "react/jsx-runtime";
import { Box, Text } from "ink";
import { toneColor } from "./design/terminalTheme.js";
export function ToolUseLoader(props) {
    const model = toolUseLoaderModel(props.status, props.blinkOn);
    return (_jsx(Box, { minWidth: 2, children: _jsx(Text, { color: toneColor(model.tone), dimColor: model.dim, children: model.glyph }) }));
}
export function toolUseLoaderModel(status, blinkOn = true) {
    if (status === "failed") {
        return { glyph: "x", tone: "error", dim: false, label: "failed" };
    }
    if (status === "succeeded") {
        return { glyph: "+", tone: "success", dim: false, label: "done" };
    }
    if (status === "queued") {
        return { glyph: ".", tone: "muted", dim: true, label: "queued" };
    }
    return {
        glyph: blinkOn ? "*" : " ",
        tone: "warning",
        dim: false,
        label: "running",
    };
}
