import type { LiveStreamData } from '../../types' import { extrapolateClock } from '../../lib/live' import { WeatherStrip } from './WeatherStrip' interface Props { isLive: boolean snapshot: LiveStreamData connection: 'connected' | 'connecting' | 'disconnected' | 'error' now: number } export function SessionBanner({ isLive, snapshot, connection, now }: Props) { const session = snapshot.Session const clock = extrapolateClock(snapshot.Clock, snapshot.ClockRefTime, snapshot.ClockExtrapolating, now) return (
{connection}

{session?.MeetingName || 'Live Timing'}

{[session?.SessionName, session?.CircuitName].filter(Boolean).join(' ยท ') || 'F1 live feed'}

L{snapshot.CurrentLap || '-'}/{snapshot.TotalLaps || '-'} {clock && {clock}} {isLive ? 'live' : 'stale'}
) }