import { Scale, AlertTriangle } from "lucide-react";
import { Badge } from "@/components/ui/badge";
import type { Halacha } from "@/lib/api/precedent-library";
/* X11 — citation corroboration signal for a halacha.
*
* Shows how many distinct later courts/committees adopted this halacha
* (positive treatment). ≥2 distinct positive sources = "מתוקף" (the
* auto-approve threshold, INV-COR4); a single citation is shown more
* softly. A negative treatment (distinguished/criticized/overruled) is
* surfaced as a warning — those never auto-approve and an overruled one
* is sent back to the chair gate (INV-COR2). Renders nothing when there
* is no citation signal at all. */
export function CorroborationBadge({ halacha }: { halacha: Halacha }) {
const count = halacha.corroboration_count ?? 0;
const negative = halacha.corroboration_negative ?? false;
if (negative) {
return (
טיפול שלילי בציטוט
);
}
if (count <= 0) return null;
const corroborated = count >= 2;
return (
{corroborated ? `מתוקף · ${count} ציטוטים` : "ציטוט מאמת · 1"}
);
}