'use client'; import { Badge } from '@/ui/Badge'; import { Icon } from '@/ui/Icon'; import { Link } from '@/ui/Link'; import { Text } from '@/ui/Text'; import { Box } from '@/ui/Box'; import { Group } from '@/ui/Group'; import { RaceCard, RaceTimeColumn, RaceInfo } from '@/ui/RaceCard'; import { Car, Trophy, Zap, ArrowRight, Clock, PlayCircle, CheckCircle2, XCircle, HelpCircle } from 'lucide-react'; import React from 'react'; const ICON_MAP = { Clock, PlayCircle, CheckCircle2, XCircle, HelpCircle, }; interface RaceListItemProps { track: string; car: string; timeLabel?: string; relativeTimeLabel?: string; dateLabel?: string; dayLabel?: string; status: string; statusLabel: string; statusVariant: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info'; statusIconName: string; leagueName?: string | null; leagueHref?: string; strengthOfField?: number | null; onClick: () => void; } export function RaceListItem({ track, car, timeLabel, relativeTimeLabel, dateLabel, dayLabel, status, statusLabel, statusVariant, statusIconName, leagueName, leagueHref, strengthOfField, onClick, }: RaceListItemProps) { const isLive = status === 'running'; const StatusIcon = ICON_MAP[statusIconName as keyof typeof ICON_MAP] || HelpCircle; return ( {statusLabel} } meta={ {strengthOfField && ( SOF {strengthOfField} )} {leagueName && leagueHref && ( e.stopPropagation()} variant="primary" > {leagueName} )} } /> ); }