'use client'; import { CountryFlagFormatter } from '@/lib/formatters/CountryFlagFormatter'; import { Badge } from '@/ui/Badge'; import { Box } from '@/ui/Box'; import { Group } from '@/ui/Group'; import { Image } from '@/ui/Image'; import { PositionBadge, ResultPoints, ResultRow } from '@/ui/ResultRow'; import { Stack } from '@/ui/Stack'; import { Surface } from '@/ui/Surface'; import { Text } from '@/ui/Text'; interface ResultEntry { position: number; driverId: string; driverName: string; driverAvatar: string; country: string; car: string; laps: number; time: string; fastestLap: string; points: number; incidents: number; isCurrentUser: boolean; } interface RaceResultRowProps { result: ResultEntry; points: number; } export function RaceResultRow({ result, points }: RaceResultRowProps) { const { isCurrentUser, position, driverAvatar, driverName, country, car, laps, incidents, time, fastestLap } = result; return ( {/* Avatar */} {driverName} {CountryFlagFormatter.fromCountryCode(country).toString()} {/* Driver Info */} {driverName} {isCurrentUser && ( YOU )} {car} Laps: {laps} Incidents: {incidents} {/* Times */} {time} FL: {fastestLap} {/* Points */} ); }