import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Box, Text } from "ink";
import { c } from "../theme.js";
export function HeaderBar({ model, step, maxSteps, inputTokens, outputTokens, contextTokens, maxContextTokens, workspaceRoot, indexStatus, }) {
    const contextPct = maxContextTokens > 0
        ? Math.min(100, Math.round((contextTokens / maxContextTokens) * 100))
        : 0;
    const contextColor = contextPct >= 80 ? c.red : contextPct >= 60 ? c.yellow : c.green;
    return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", paddingX: 1, children: [_jsxs(Box, { children: [_jsx(Text, { bold: true, children: c.cyan("minicode") }), _jsx(Text, { children: "  " }), _jsxs(Text, { children: [c.dim("model:"), " "] }), _jsx(Text, { children: model || "—" }), _jsx(Text, { children: "  " }), _jsxs(Text, { children: [c.dim("steps:"), " "] }), _jsxs(Text, { children: [step, "/", maxSteps] }), _jsx(Text, { children: "  " }), _jsxs(Text, { children: [c.dim("tokens:"), " "] }), _jsxs(Text, { children: [inputTokens, " in / ", outputTokens, " out"] })] }), _jsxs(Box, { children: [_jsxs(Text, { children: [c.dim("cwd:"), " "] }), _jsx(Text, { children: workspaceRoot || "—" }), _jsx(Text, { children: "  " }), _jsxs(Text, { children: [c.dim("index:"), " "] }), _jsx(Text, { children: indexStatus || "—" }), _jsx(Text, { children: "  " }), _jsxs(Text, { children: [c.dim("context:"), " "] }), _jsx(Text, { children: contextColor(`${contextPct}%`) }), _jsx(Text, { children: " " }), _jsxs(Text, { dimColor: true, children: ["(~", contextTokens.toLocaleString(), "/", maxContextTokens.toLocaleString(), ")"] })] })] }));
}
