import type { CSSProperties } from 'react' import type { GroupedYear } from '../../../lib/timeline.ts' import TimelineEntry from './TimelineEntry.tsx' /** A solid teal dot per year, its size growing with the year's * entries so the rail reads as a density chart. (A vine or tree * drawing may replace the dots later.) */ function dotSize(count: number): string { return `${(9 + Math.min(count, 14) * 0.6).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 = `site-tl-year-${year.year}` const className = [ 'site-tl__year', year.featured ? 'site-tl__year--featured' : '', open ? 'site-tl__year--open' : '', empty ? 'site-tl__year--empty' : '', ] .filter(Boolean) .join(' ') return (