import type { DataQualitySummary } from "@dci/core"; import { AlertTriangle, Info, ShieldAlert } from "lucide-react"; import Link from "next/link"; import { cn } from "@/components/ui/cn"; import { fmtDate, fmtInt } from "@/lib/format"; import { fieldLabel } from "@/lib/field-labels"; import { routes } from "@/lib/routes"; function Cell({ label, value, note }: { label: string; value: string; note?: string }) { return (
{value}
{label}
{note &&
{note}
}
); } const SEV_ICON = { info: Info, warn: AlertTriangle, critical: ShieldAlert } as const; /** DATA QUALITY block: sources, completeness, claims (current / unscoped / review), open flags, duplicate review. */ export function DataQualityPanel({ q, completenessNote }: { q: DataQualitySummary; completenessNote?: string }) { return (

Open quality flags

{fmtInt(q.openFlags.length)}
{q.openFlags.length === 0 && !q.pendingDuplicate ? (

No open flag. Automated sanity checks (scope, density, magnitude, 5× change) passed for every current figure.

) : ( )}

Flags are opened automatically by the sanity engines and closed by review; a critical flag keeps a figure visible but marked.{" "} How quality is scored

); }