import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Box, Text } from "ink";
function formatTime(iso) {
    const date = new Date(iso);
    return date.toLocaleTimeString("en-US", { hour12: false });
}
export function EventLog({ events }) {
    if (!events || events.length === 0) {
        return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, children: "Recent Events" }), _jsx(Text, { dimColor: true, children: "Waiting for events..." })] }));
    }
    // Show most recent 10 events
    const recent = events.slice(0, 10);
    return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, children: "Recent Events" }), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { dimColor: true, children: ["Time".padEnd(10), "Agent".padEnd(14), "Provider".padEnd(10), "Model".padEnd(20), "Cost".padStart(8), "Latency".padStart(10)] }) }), recent.map((event, index) => (_jsx(Box, { children: _jsxs(Text, { children: [formatTime(event.timestamp).padEnd(10), event.agent_id.slice(0, 13).padEnd(14), event.provider.padEnd(10), event.model.slice(0, 19).padEnd(20), `$${event.cost.toFixed(4)}`.padStart(8), `${event.latency_ms}ms`.padStart(10)] }) }, index)))] }));
}
//# sourceMappingURL=EventLog.js.map