import { useT } from "../i18n"; interface Props { scores: number[]; stepThreshold: number; latency?: number | null; } export default function AlertBanner({ scores, stepThreshold, latency }: Props) { const t = useT(); const peak = scores.length ? Math.max(...scores) : 0; const alert = peak >= stepThreshold; return (
{alert ? t.alert.alert : t.alert.nominal} {t.alert.peak} {peak.toFixed(3)} / {t.alert.threshold} {stepThreshold.toFixed(3)} {alert && latency != null ? ` / ${t.alert.latency} ${latency.toFixed(0)}s` : ""}
); }