import { jsx as _jsx } from "react/jsx-runtime";
import { Text } from "ink";
import { toneColor } from "./terminalTheme.js";
export function statusIconModel(state) {
    if (state === "success")
        return { icon: "ok", tone: "success" };
    if (state === "error")
        return { icon: "x", tone: "error" };
    if (state === "warning")
        return { icon: "!", tone: "warning" };
    if (state === "info")
        return { icon: "i", tone: "brand" };
    if (state === "loading")
        return { icon: "..", tone: "muted" };
    return { icon: "-", tone: "muted" };
}
export function StatusIcon(props) {
    const model = statusIconModel(props.state);
    return (_jsx(Text, { color: toneColor(model.tone), children: `[${model.icon}]${props.withSpace ? " " : ""}` }));
}
