import { ArrowDownIcon } from 'lucide-react' import { CARD_DOWNLOAD_COUNTS_CAPTION, CARD_DOWNLOAD_COUNTS_EMPTY_BODY, CARD_DOWNLOAD_COUNTS_EMPTY_CAPTION, CARD_DOWNLOAD_COUNTS_EMPTY_TITLE, CARD_DOWNLOAD_COUNTS_SUBTITLE, CARD_DOWNLOAD_COUNTS_TITLE, type CardDownloadCountsView, } from '@/lib/cardDownloadCounts' import { formatElectionNumber } from '@/lib/electionFormat' /** * S32 — the "Cards" block of the staff home: one absolute download counter per * card model, in the natural catalog order (six columns on desktop, one row per * model on mobile). It counts downloads, never people — no total, no * percentage, no series — and an unavailable aggregate omits the whole block * instead of claiming "no downloads yet". */ export const CampaignHomeCardDownloads = ({ view }: { view: CardDownloadCountsView }) => { if (view.state === 'unavailable') return null return (
{/* `border-b-0 pb-0` neutralize the global `h2 { border-b pb-2 }` rule: the approved divider sits at the end of the summary above, not under this heading. */}

{CARD_DOWNLOAD_COUNTS_TITLE}

{view.state === 'empty' ? ( <>

{CARD_DOWNLOAD_COUNTS_EMPTY_TITLE}

{CARD_DOWNLOAD_COUNTS_EMPTY_BODY}

{CARD_DOWNLOAD_COUNTS_EMPTY_CAPTION}

) : ( <>

{CARD_DOWNLOAD_COUNTS_SUBTITLE}

{view.counts.map((entry) => (
{entry.label}
{formatElectionNumber(entry.count)}
))}

{CARD_DOWNLOAD_COUNTS_CAPTION}

)}
) }