import { useState } from 'react' /** One verbatim passage from a recorded public meeting. */ export interface Passage { quote: string /** "Audra T." (#1036): first name + last initial, or first name only; null when no name was heard. */ speakerName?: string | null speakerRole?: string | null jurisdictionName: string meetingDate?: string | null videoUrl?: string | null startSeconds?: number | null /** The item the words were about (a decision's headline), shown when the quote alone does not say. */ about?: string | null } export interface Sides { for: Passage[] against: Passage[] } const SHOWN = 2 /** The recording at the moment of the quote: a `t=` parameter, or none when the start time is not known. */ export function passageLink(p: Passage): string | null { if (!p.videoUrl) return null if (p.startSeconds == null || !Number.isFinite(p.startSeconds)) return p.videoUrl try { const u = new URL(p.videoUrl) u.searchParams.set('t', `${Math.max(0, Math.floor(p.startSeconds))}s`) return u.toString() } catch { return p.videoUrl } } /** One side's quotes: each with who said it, where, when, and a link to the moment in the recording. */ export function SideColumn({ title, items }: { title: string; items: Passage[] }) { const [all, setAll] = useState(false) const shown = all ? items : items.slice(0, SHOWN) return (
{title}
“{p.quote}”
{p.about && On: {p.about} · } {who} {href && ( <> {' · '} Watch this moment > )}