@@ -10,17 +10,14 @@ import {
APPEAL_SUBTYPE_LABELS ,
isBlamSubtype ,
} from "@/lib/practice-area" ;
import {
Popover ,
PopoverContent ,
PopoverTrigger ,
} from "@/components/ui/popover" ;
import { Users } from "lucide-react" ;
import type { CaseDetail } from "@/lib/api/cases" ;
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
@@ -38,7 +35,9 @@ export function CaseHeader({
actions? : ReactNode ;
tabs? : ReactNode ;
} ) {
const parties = partiesLine ( data ) ;
const appellants = data ? . appellants ? . filter ( Boolean ) ? ? [ ] ;
const respondents = data ? . respondents ? . filter ( Boolean ) ? ? [ ] ;
const hasParties = appellants . length > 0 || respondents . length > 0 ;
const isBlam =
data ? . proceeding_type === 'בל"מ' || isBlamSubtype ( data ? . appeal_subtype ) ;
@@ -61,6 +60,12 @@ export function CaseHeader({
< span className = "tabular-nums" >
{ data ? . proceeding_type ? ? "ערר" } { data ? . case_number ? ? "—" }
< / span >
{ /* case subject on the same line, smaller font (chair request) */ }
{ data ? . title && (
< span className = "text-navy/75 text-lg font-semibold leading-snug" >
{ data . title }
< / span >
) }
{ data ? . status && < StatusBadge status = { data . status } / > }
{ data ? . archived_at && (
< Badge
@@ -92,27 +97,44 @@ export function CaseHeader({
) }
< / h1 >
{ /* case title / subject under the heading */ }
{ data ? . title && (
< p className = "text-navy/90 text-base font-semibold mt-2 max-w-3xl leading-snug" >
{ data . title }
< / p >
) }
{ /* parties line (mockup .parties) — clamped to 2 lines so a long list
of appellants/respondents doesn't grow the band; full text on hover. */ }
{ parties ? (
< p className = "text-ink-soft text-sm mt-1.5 max-w-3xl line-clamp-2" title = { parties } >
{ parties }
< / p >
) : data ? . subject ? (
< p className = "text-ink-soft text-sm mt-1.5 max-w-3xl leading-relaxed line-clamp-2"
title = { data . subject } >
{ data . subject }
< / p >
) : null }
{ /* case actions — kept verbatim, moved into the band */ }
{ /* case actions — parties now live in a popover (chair request) so
they don't push the tab content down the page. */ }
< div className = "flex items-center gap-2 flex-wrap mt-3" >
{ hasParties && (
< Popover >
< PopoverTrigger asChild >
< button
type = "button"
className = "inline-flex items-center gap-1.5 rounded-md border border-rule bg-surface px-3 py-1.5 text-[0.82rem] font-semibold text-ink-soft hover:bg-parchment transition-colors"
>
< Users className = "w-3.5 h-3.5" / >
צ ד ד י ם
< / button >
< / PopoverTrigger >
< PopoverContent align = "start" className = "w-72 p-3 space-y-2.5 text-sm" >
{ appellants . length > 0 && (
< div >
< div className = "text-[0.7rem] font-bold text-gold-deep uppercase tracking-wider mb-1" >
ע ו ר ר י ם
< / div >
< ul className = "space-y-0.5 text-ink-soft" >
{ appellants . map ( ( a , i ) = > < li key = { ` a ${ i } ` } > { a } < / li > ) }
< / ul >
< / div >
) }
{ respondents . length > 0 && (
< div >
< div className = "text-[0.7rem] font-bold text-gold-deep uppercase tracking-wider mb-1" >
מ ש י ב י ם
< / div >
< ul className = "space-y-0.5 text-ink-soft" >
{ respondents . map ( ( r , i ) = > < li key = { ` r ${ i } ` } > { r } < / li > ) }
< / ul >
< / div >
) }
< / PopoverContent >
< / Popover >
) }
{ data ? . case_number && (
< CaseArchiveAction
caseNumber = { data . case_number }