import type { CSSProperties } from 'react' import type { GroupedYear } from '../../../lib/timeline.ts' import TimelineEntry from './TimelineEntry.tsx' /** Dot diameter scales with volume, so the rail reads as a density chart. */ function dotSize(count: number): string { return `${(7 + Math.min(count, 14) * 0.55).toFixed(2)}px` } type Props = { year: GroupedYear open: boolean onToggle: (year: number) => void } export default function TimelineYear({ year, open, onToggle }: Props) { const empty = year.count === 0 const panelId = `ngu-tl-year-${year.year}` const className = [ 'ngu-tl__year', year.featured ? 'ngu-tl__year--featured' : '', open ? 'ngu-tl__year--open' : '', empty ? 'ngu-tl__year--empty' : '', ] .filter(Boolean) .join(' ') return (