import { Activity } from 'lucide-react'; import { useMetrics } from '../../hooks/useMetrics'; import { formatDuration } from '../../lib/text'; function Gauge({ value, max, label, display, warn }: { value: number; max: number; label: string; display: string; warn?: number }) { const ratio = Math.max(0, Math.min(1, value / max)); const r = 24; const c = 2 * Math.PI * r; const arc = c * 0.75; const color = warn !== undefined && value >= warn ? 'var(--danger)' : 'var(--accent)'; return (
{display} {label}
); } export function Telemetry() { const m = useMetrics(true); return (
Système {m.live ? m.hostname : 'HORS PONT'}
{m.cpuCores} cœurs{m.cpuModel ? ` · ${m.cpuModel.replace(/\(R\)|\(TM\)|CPU|@.*$/g, '').trim()}` : ''} {m.memTotalGb ? `${m.memTotalGb} Go` : ''}{m.uptimeSec ? ` · up ${formatDuration(m.uptimeSec)}` : ''}
); }