import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Box, Text } from "ink";
function formatUptime(seconds) {
    if (seconds == null)
        return "--";
    const hours = Math.floor(seconds / 3600);
    const minutes = Math.floor((seconds % 3600) / 60);
    return `${hours}h ${minutes}m`;
}
function formatNumber(n) {
    if (n == null)
        return "--";
    return n.toLocaleString("en-US");
}
function formatCost(n) {
    if (n == null)
        return "--";
    return n.toFixed(2);
}
export function StatusBar({ uptimeSeconds, requestsToday, costToday, serverStatus, proxyStatus, }) {
    const serverColor = serverStatus === "running" ? "green" : serverStatus === "disconnected" ? "red" : "yellow";
    const proxyColor = proxyStatus === "running" ? "green" : "yellow";
    const serverIndicator = serverStatus === "running" ? "\u25CF" : "\u25CB";
    const proxyIndicator = proxyStatus === "running" ? "\u25CF" : "\u25CB";
    return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, children: "AgentGazer Overview" }), _jsxs(Box, { marginTop: 1, children: [_jsxs(Text, { children: ["Uptime: ", formatUptime(uptimeSeconds), " | Requests: ", formatNumber(requestsToday), " | Cost: $", formatCost(costToday), " |", " "] }), _jsxs(Text, { color: serverColor, children: ["Server: ", serverIndicator] }), _jsx(Text, { children: " | " }), _jsxs(Text, { color: proxyColor, children: ["Proxy: ", proxyIndicator] }), serverStatus === "disconnected" && _jsx(Text, { color: "red", children: " (disconnected)" })] })] }));
}
//# sourceMappingURL=StatusBar.js.map