"use client"; import type { ProvLevel, Loc } from "@/lib/data"; import { useT } from "@/components/locale-provider"; const PROV_COLOR: Record = { 0: "var(--prov-0)", // not available / licence 1: "var(--prov-1)", // one source 2: "var(--prov-2)", // partially confirmed 3: "var(--prov-3)", // multiple sources agree }; const PROV_LABEL: Record = { 0: { en: "Not available / licence", sv: "Ej tillgänglig / licens" }, 1: { en: "One source", sv: "En källa" }, 2: { en: "Partially confirmed", sv: "Delvis bekräftad" }, 3: { en: "Multiple sources agree", sv: "Flera källor överens" }, }; /** * The product's whole promise in one chip: where a value came from and how * confident we are. The ONLY place non-mono color (besides the single red CTA) * is allowed to appear. */ export function ProvenanceBadge({ level, source, freshness, }: { level: ProvLevel; source: string; freshness?: string; }) { const t = useT(); return ( {source} {freshness ? ( <> · {freshness} ) : null} ); } /** Just the 9px status square — for the end of table cells. */ export function CellProvenance({ level }: { level: ProvLevel }) { const t = useT(); return ( ); } export const PROVENANCE_LEGEND: { level: ProvLevel; text: Loc }[] = [ { level: 3, text: { en: "Multiple sources agree", sv: "Flera källor överens" } }, { level: 2, text: { en: "Partially confirmed", sv: "Delvis bekräftad" } }, { level: 1, text: { en: "One source", sv: "En källa" } }, { level: 0, text: { en: "Licence required / not available", sv: "Licens krävs / ej tillgänglig" } }, ];