import type { ReactNode } from 'react' import { cn } from '../../lib/cn' import { StatusDot, type StatusDotTone } from '../StatusDot' import { Text } from '../Text' export interface TimelineItem { id: string title: string /** Timestamp or short qualifier, shown above the title. */ meta?: string description?: ReactNode tone?: StatusDotTone } export interface TimelineProps { items: TimelineItem[] /** Accessible name for the sequence. */ label?: string /** Merged last, so it wins. */ className?: string } /** * An ordered sequence of events. The connector is drawn between the markers * rather than through them, so a long description never breaks the line. */ export function Timeline({ items, label, className }: TimelineProps) { return (
    {items.map((item, index) => (
  1. {index < items.length - 1 && }
    {item.meta && ( {item.meta} )} {item.title} {item.description && ( {item.description} )}
  2. ))}
) }