import type { ReactNode } from "react"; import Link from "next/link"; import { Badge } from "@/components/ui/badge"; import { StatusBadge } from "@/components/cases/status-badge"; import { SyncIndicator } from "@/components/cases/sync-indicator"; import { CaseArchiveAction } from "@/components/cases/case-archive-action"; import { CreateRepoButton } from "@/components/cases/create-repo-button"; import { PRACTICE_AREA_LABELS, APPEAL_SUBTYPE_LABELS, isBlamSubtype, } from "@/lib/practice-area"; import type { CaseDetail } from "@/lib/api/cases"; function formatDate(iso?: string | null) { if (!iso) return "—"; try { return new Date(iso).toLocaleDateString("he-IL", { day: "2-digit", month: "2-digit", year: "numeric", }); } catch { return iso ?? "—"; } } function partiesLine(data?: CaseDetail): string | null { const appellant = data?.appellants?.filter(Boolean) ?? []; const respondent = data?.respondents?.filter(Boolean) ?? []; const parts: string[] = []; if (appellant.length) parts.push(`עוררת: ${appellant.join(", ")}`); if (respondent.length) parts.push(`משיבה: ${respondent.join(", ")}`); return parts.length ? parts.join(" · ") : null; } /** * Case header — parchment band (IA-redesign mockup 17): full-bleed band with * the case title + status/type chips inline, a parties line, the case actions * (edit / archive / repo / sync), and a metadata strip. The `tabs` slot renders * the tab strip inside the band, anchored to its bottom edge. */ export function CaseHeader({ data, actions, tabs, }: { data?: CaseDetail; actions?: ReactNode; tabs?: ReactNode; }) { const parties = partiesLine(data); const isBlam = data?.proceeding_type === 'בל"מ' || isBlamSubtype(data?.appeal_subtype); return (
{data.title}
)} {/* parties line (mockup .parties) */} {parties ? ({parties}
) : data?.subject ? ({data.subject}
) : null} {/* case actions — kept verbatim, moved into the band */}