import { RankBadge } from '@/components/leaderboards/RankBadge'; import { RatingFormatter } from '@/lib/formatters/RatingFormatter'; import { SkillLevelFormatter } from '@/lib/formatters/SkillLevelFormatter'; import { Avatar } from '@/ui/Avatar'; import { Group } from '@/ui/Group'; import { LeaderboardList } from '@/ui/LeaderboardList'; import { LeaderboardPreviewShell } from '@/ui/LeaderboardPreviewShell'; import { LeaderboardRow } from '@/ui/LeaderboardRow'; import { Text } from '@/ui/Text'; import { Trophy } from 'lucide-react'; interface DriverLeaderboardPreviewProps { title?: string; subtitle?: string; drivers: { id: string; name: string; rating: number; skillLevel: string; nationality: string; wins: number; rank: number; avatarUrl: string; position: number; }[]; onDriverClick: (id: string) => void; onNavigateToDrivers: () => void; } export function DriverLeaderboardPreview({ title = "Driver Rankings", subtitle = "Top Performers", drivers, onDriverClick, onNavigateToDrivers }: DriverLeaderboardPreviewProps) { const top10 = drivers; // Already sliced in builder return ( {top10.map((driver, index) => { const position = index + 1; return ( onDriverClick(driver.id)} rank={} identity={ {driver.name} {driver.nationality} {SkillLevelFormatter.getLabel(driver.skillLevel)} } stats={ {RatingFormatter.format(driver.rating)} Rating {driver.wins} Wins } /> ); })} ); }