import React from 'react'; import { Trophy, Crown, Users } from 'lucide-react'; import type { TeamSummaryViewModel } from '@/lib/view-models/TeamSummaryViewModel'; import { getMediaUrl } from '@/lib/utilities/media'; import { Box } from '@/ui/Box'; import { Stack } from '@/ui/Stack'; import { Text } from '@/ui/Text'; import { Icon } from '@/ui/Icon'; import { Button } from '@/ui/Button'; import { Image } from '@/ui/Image'; import { Podium, PodiumItem } from '@/ui/Podium'; interface TopThreePodiumProps { teams: TeamSummaryViewModel[]; onClick: (id: string) => void; } export function TopThreePodium({ teams, onClick }: TopThreePodiumProps) { const top3 = teams.slice(0, 3) as [TeamSummaryViewModel, TeamSummaryViewModel, TeamSummaryViewModel]; if (teams.length < 3) return null; // Display order: 2nd, 1st, 3rd const podiumOrder: [TeamSummaryViewModel, TeamSummaryViewModel, TeamSummaryViewModel] = [ top3[1], top3[0], top3[2], ]; const podiumHeights = ['28', '36', '20']; const podiumPositions = [2, 1, 3]; const getPositionColor = (position: number) => { switch (position) { case 1: return 'text-yellow-400'; case 2: return 'text-gray-300'; case 3: return 'text-amber-600'; default: return 'text-gray-500'; } }; const getBgColor = (position: number) => { switch (position) { case 1: return 'bg-gradient-to-br from-primary-blue/20 via-iron-gray/80 to-deep-graphite'; case 2: return 'bg-iron-gray'; case 3: return 'bg-gradient-to-br from-purple-600/20 via-iron-gray/80 to-deep-graphite'; default: return 'bg-iron-gray/50'; } }; return ( {podiumOrder.map((team, index) => { const position = podiumPositions[index] ?? 0; return ( onClick(team.id)} h="auto" mb={4} p={0} transition > {/* Crown for 1st place */} {position === 1 && ( )} {/* Team logo */} {team.name} {/* Team name */} {team.name} {/* Category */} {team.category && ( {team.category} )} {/* Rating placeholder */} {/* Stats row */} {team.totalWins} {team.memberCount} } /> ); })} ); }