Files
OmniRoute/bin/cli/tui-components/ProgressBar.jsx
diegosouzapw 59128b6742 feat(cli): TUI dashboard interativo e menu de interface (Fases 8.10+8.9)
Adiciona dashboard TUI com 7 abas (Overview, Combos, Providers, Keys, Logs, Health, Cost)
via Ink, 13 componentes reutilizáveis em tui-components/, menu interativo ao iniciar sem
subcomando, e flag --tui no comando dashboard.
2026-05-15 04:36:21 -03:00

16 lines
463 B
JavaScript

import React from "react";
import { Box, Text } from "ink";
export function ProgressBar({ value = 0, max = 100, width = 20, color = "green" }) {
const pct = Math.min(1, Math.max(0, value / max));
const filled = Math.round(pct * width);
const empty = width - filled;
return (
<Box>
<Text color={color}>{"█".repeat(filled)}</Text>
<Text dimColor>{"░".repeat(empty)}</Text>
<Text> {Math.round(pct * 100)}%</Text>
</Box>
);
}