"use client"; import Link from "next/link"; import type { ReactNode } from "react"; import { Badge } from "@/components/ui/badge"; import { practiceAreaLabel } from "@/components/precedents/practice-area"; import type { Digest } from "@/lib/api/digests"; import { formatDateShort as formatDate } from "@/lib/format-date"; /** * Presentational card for a single digest ("כל יום" radar entry). * * A digest is a SECONDARY source that POINTS at a ruling — the card makes the * pointer-not-citation nature explicit: the underlying ruling's citation is * shown with a link-status badge (linked → the ruling is in the precedent * library; unlinked → an open knowledge gap, INV-DIG3). */ export function DigestCard({ digest, score, actions, }: { digest: Digest; score?: number; actions?: ReactNode; }) { const linked = Boolean(digest.linked_case_law_id); const pending = digest.extraction_status !== "completed"; return (
{/* top row — yomon-number + date at start, concept tag pushed to end */}
{digest.yomon_number && ( יומון {digest.yomon_number} )} {digest.digest_date && ( · {formatDate(digest.digest_date)} )} {digest.publication && digest.publication !== "כל יום" && ( {digest.publication} )} {digest.digest_kind === "announcement" && ( עדכון )} {digest.digest_kind === "article" && ( מאמר )} {digest.concept_tag && ( {digest.concept_tag} )} {typeof score === "number" && ( דירוג {score.toFixed(2)} )}
{/* holding — the digest headline */} {digest.headline_holding && (

{digest.headline_holding}

)} {/* source ruling — "מקור:" + citation, start-bordered (mockup `.ruling`) */}
מקור:{" "} {digest.underlying_citation || "—"}
{digest.summary && (

{digest.summary}

)} {digest.practice_area && ( {practiceAreaLabel(digest.practice_area)} )} {digest.subject_tags?.length > 0 && (
{digest.subject_tags.map((t) => ( {t} ))}
)} {/* foot — link-status chip + passive "ממתין לעיבוד" label (mockup `.foot`) */}
{linked ? ( מקושר לפסיקה ↗ ) : ( לא מקושר )} {pending && ( /* passive status label — a dot + text, deliberately NOT a button */ {digest.extraction_status === "pending" ? "ממתין לעיבוד" : digest.extraction_status} )}
{actions && (
{actions}
)}
); }