import { useWeekendContext } from '../hooks/useWeekendContext' import { BetweenRacesView } from '../components/weekend/BetweenRacesView' import { BetweenSessionsView } from '../components/weekend/BetweenSessionsView' import { LiveHandoffView } from '../components/weekend/LiveHandoffView' import { PreSessionView } from '../components/weekend/PreSessionView' import { WeekendError, WeekendLimited, WeekendLoading } from '../components/weekend/StatusViews' import type { WeekendContext } from '../types' import '../styles/weekend.css' function renderState(context: WeekendContext, now: Date) { switch (context.state) { case 'loading': return case 'error': return case 'limited_data': return case 'between_races': case 'post_weekend': case 'season_complete': return case 'between_sessions': case 'session_settling': return case 'session_live': return case 'pre_session': return default: return } } export function WeekendPage() { const { context, now } = useWeekendContext() return (
{renderState(context, now)}
) }