/* ═══════════════════════════════════════════════════════════════ AWARD DETAIL: /awards/:id The thinnest of the four, by design. `awards` has no links and no content blocks, 'award' isn't in the owner_kind CHECK on either polymorphic table, and widening it means rebuilding two STRICT tables. `description` is the prose. So the recipients are the page. They're rendered as a list rather than as PeopleTiles because each one carries a citation, and a citation is the point of an award, it doesn't belong folded behind a chevron. Note also that `awards` has no is_published column: every row here is live the moment it's created. Worth an ADD COLUMN before this ships. ═══════════════════════════════════════════════════════════════ */ import { Link, useParams } from 'react-router-dom' import PageShell from '../components/PageShell.tsx' import PageState from '../components/PageState.tsx' import { useAward, type Recipient } from '../lib/useContent.ts' import { eventHref, orgHref, personHref } from '../lib/hrefs.ts' import { mediaUrl, initials } from '../lib/media.ts' import { accentText, BRAND } from '../lib/color.ts' const BODY = 'var(--color-muted)' export default function AwardDetail() { const { id } = useParams() const { data: award, loading, error, notFound, reload } = useAward(id) if (!award) { return ( ) } const accent = BRAND const logo = mediaUrl(award.logo) return (
{logo && ( )} {award.org && ( Given by{' '} {award.org.name} )} {award.recipients.length}{' '} {award.recipients.length === 1 ? 'recipient' : 'recipients'}
    {award.recipients.map((recipient, index) => (
  1. ))}
), }, ]} /> ) } function RecipientRow({ recipient, accent }: { recipient: Recipient; accent: string }) { const photo = mediaUrl(recipient.photo) return (
{photo ? ( ) : ( )}

{recipient.name}

{[ year(recipient.awarded_on), recipient.tagline, ] .filter(Boolean) .join(' · ')} {recipient.event && ( <> {(recipient.awarded_on || recipient.tagline) && ' · '} {recipient.event.title} )}

{recipient.citation && (

{recipient.citation}

)}
) } /* awarded_on may be a partial date, so this takes the leading year rather than parsing. A full date would be false precision on a row backfilled from a program booklet. */ function year(date?: string | null): string | null { if (!date) return null const match = /^(\d{4})/.exec(date) return match ? match[1] : date }