import { useEffect, useState } from 'react' import { fetchHealth, type Health } from '../lib/dev' export function HealthStrip() { const [h, setH] = useState(null) useEffect(() => { fetchHealth().then(setH).catch(() => {}) }, []) if (!h) return null const pct = (n: number) => `${(n * 100).toFixed(1)}%` return (
Health
0.05 ? 'warn' : 'ok'} /> 0 ? 'warn' : 'ok'} />
) } function Pill({ label, value, tone = 'ok' }: { label: string; value: string; tone?: 'ok' | 'warn' }) { const color = tone === 'warn' ? 'text-amber-400' : 'text-emerald-400' return (
{label}
{value}
) }