import { Box } from '@/ui/Box'; import { Image } from '@/ui/Image'; import { Stack } from '@/ui/Stack'; import { Text } from '@/ui/Text'; interface PodiumDriver { id: string; name: string; avatarUrl: string; rating: number; wins: number; podiums: number; } interface RankingsPodiumProps { podium: PodiumDriver[]; onDriverClick?: (id: string) => void; } export function RankingsPodium({ podium, onDriverClick }: RankingsPodiumProps) { return ( {[1, 0, 2].map((index) => { const driver = podium[index]; if (!driver) return null; const position = index === 1 ? 1 : index === 0 ? 2 : 3; const config = { 1: { height: '10rem', color: 'rgba(250, 204, 21, 0.2)', borderColor: 'rgba(250, 204, 21, 0.4)', crown: '#facc15' }, 2: { height: '8rem', color: 'rgba(209, 213, 219, 0.2)', borderColor: 'rgba(209, 213, 219, 0.4)', crown: '#d1d5db' }, 3: { height: '6rem', color: 'rgba(217, 119, 6, 0.2)', borderColor: 'rgba(217, 119, 6, 0.4)', crown: '#d97706' }, }[position] || { height: '6rem', color: 'rgba(217, 119, 6, 0.2)', borderColor: 'rgba(217, 119, 6, 0.4)', crown: '#d97706' }; return ( onDriverClick?.(driver.id)} display="flex" flexDirection="col" alignItems="center" bg="transparent" border={false} cursor="pointer" > {driver.name} {position} {driver.name} {driver.rating.toString()} 🏆 {driver.wins} 🏅 {driver.podiums} {position} ); })} ); }