'use client'; import React from 'react'; import { Users, Zap } from 'lucide-react'; import { Card } from '@/ui/Card'; import { Stack } from '@/ui/Stack'; import { Heading } from '@/ui/Heading'; import { Text } from '@/ui/Text'; import { Box } from '@/ui/Box'; import { Image } from '@/ui/Image'; import { Badge } from '@/ui/Badge'; import { Icon } from '@/ui/Icon'; import { Surface } from '@/ui/Surface'; import { CountryFlagDisplay } from '@/lib/display-objects/CountryFlagDisplay'; interface Entry { id: string; name: string; avatarUrl: string; country: string; rating?: number | null; isCurrentUser: boolean; } interface RaceEntryListProps { entries: Entry[]; onDriverClick: (driverId: string) => void; } export function RaceEntryList({ entries, onDriverClick }: RaceEntryListProps) { return ( }>Entry List {entries.length} drivers {entries.length === 0 ? ( No drivers registered yet ) : ( {entries.map((driver, index) => ( onDriverClick(driver.id)} style={{ display: 'flex', alignItems: 'center', gap: '0.75rem', padding: '0.75rem', borderRadius: '0.75rem', cursor: 'pointer', transition: 'all 0.2s', backgroundColor: driver.isCurrentUser ? 'rgba(59, 130, 246, 0.1)' : 'transparent', border: driver.isCurrentUser ? '1px solid rgba(59, 130, 246, 0.3)' : '1px solid transparent' }} > {index + 1} {driver.name} {CountryFlagDisplay.fromCountryCode(driver.country).toString()} {driver.name} {driver.isCurrentUser && You} {driver.country} {driver.rating != null && ( {driver.rating} )} ))} )} ); }