import { Link } from "react-router-dom";
import { useServingMetrics } from "../api/queries";
// The project's thesis, made a constant presence: the live serving outcome
// with the wrong count load-bearing. It is a MIRROR of /serving/metrics —
// it shows whatever the committed reports say, never a hard-coded zero, and
// says so honestly when the metrics can't be read.
export function WrongZeroFrame() {
const { data, isLoading, isError } = useServingMetrics();
const base =
"shrink-0 rounded-full border px-3 py-1 text-xs tabular-nums focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)]";
if (isLoading) {
return (
wrong=0 …
);
}
if (isError || !data || data.length === 0) {
return (
wrong=0: metrics unavailable
);
}
const correct = data.reduce((sum, m) => sum + m.correct, 0);
const refused = data.reduce((sum, m) => sum + m.refused, 0);
const wrong = data.reduce((sum, m) => sum + m.wrong, 0);
return (
{correct} correct · {refused} refused · 0
? "font-semibold text-[var(--color-state-contradicted)]"
: "font-semibold text-[var(--color-state-verified)]"
}
>
{wrong} wrong
);
}