import Link from 'next/link' import { getProviderColor } from '@/app/(landing)/models/components/constants' import type { CatalogModel } from '@/app/(landing)/models/utils' const SHORT_DATE_FORMAT = new Intl.DateTimeFormat('en-US', { month: 'short', day: 'numeric', year: 'numeric', timeZone: 'UTC', }) function formatShortDate(date: string): string { try { return SHORT_DATE_FORMAT.format(new Date(date)) } catch { return date } } interface ModelTimelineChartProps { models: CatalogModel[] providerId: string } const ITEM_WIDTH = 150 export function ModelTimelineChart({ models, providerId }: ModelTimelineChartProps) { const entries = models .filter((m) => m.releaseDate !== null) .map((m) => ({ model: m, date: new Date(m.releaseDate as string), dateStr: m.releaseDate as string, })) .sort((a, b) => a.date.getTime() - b.date.getTime()) if (entries.length === 0) return null const color = getProviderColor(providerId) return (

Release timeline

When each model was first publicly available.

{/* Fixed height: top labels + line + bottom labels */}
{/* Horizontal line - vertically centered */}
{entries.map(({ model, dateStr }, i) => { const left = i * ITEM_WIDTH + ITEM_WIDTH / 2 const isAbove = i % 2 === 0 return (
{/* Stem + label above */} {isAbove && (
{model.displayName} {formatShortDate(dateStr)}
)} {/* Stem + label below */} {!isAbove && (
{model.displayName} {formatShortDate(dateStr)}
)} ) })}
) }