import { DecorativeBlur } from '@/ui/DecorativeBlur'; import { Icon } from '@/ui/Icon'; import { Stack } from '@/ui/Stack'; import { Surface } from '@/ui/Surface'; import { Text } from '@/ui/Text'; import { Trophy } from 'lucide-react'; interface RaceResultHeroProps { position: number; startPosition: number; positionChange: number; incidents: number; isClean: boolean; isPodium: boolean; ratingChange?: number; animatedRatingChange: number; } export function RaceResultHero({ position, startPosition, positionChange, incidents, isClean, isPodium, ratingChange, animatedRatingChange, }: RaceResultHeroProps) { const isVictory = position === 1; const isSecond = position === 2; const isThird = position === 3; const getPositionBg = () => { if (isVictory) return 'linear-gradient(to bottom right, #facc15, #d97706)'; if (isSecond) return 'linear-gradient(to bottom right, #d1d5db, #6b7280)'; if (isThird) return 'linear-gradient(to bottom right, #3b82f6, #2563eb)'; return 'linear-gradient(to bottom right, #3b82f6, #2563eb)'; }; const getOuterBg = () => { if (isVictory) return 'linear-gradient(to right, #eab308, #facc15, #d97706)'; if (isPodium) return 'linear-gradient(to right, #9ca3af, #d1d5db, #6b7280)'; return 'linear-gradient(to right, #3b82f6, #60a5fa, #2563eb)'; }; return ( {isVictory && ( )} P{position} {isVictory ? '🏆 VICTORY!' : isSecond ? '🥈 Second Place' : isThird ? '🥉 Podium Finish' : `P${position} Finish`} Started P{startPosition} {incidents}x incidents {isClean && '✨'} {positionChange !== 0 && ( 0 ? 'rgba(16, 185, 129, 0.1)' : 'rgba(239, 68, 68, 0.1)', borderColor: positionChange > 0 ? 'rgba(16, 185, 129, 0.3)' : 'rgba(239, 68, 68, 0.3)' }} > 0 ? 'text-performance-green' : 'text-red-500'}> {positionChange > 0 ? '↑' : '↓'}{Math.abs(positionChange)} {positionChange > 0 ? 'Gained' : 'Lost'} )} {ratingChange !== undefined && ( 0 ? 'rgba(245, 158, 11, 0.1)' : 'rgba(239, 68, 68, 0.1)', borderColor: ratingChange > 0 ? 'rgba(245, 158, 11, 0.3)' : 'rgba(239, 68, 68, 0.3)' }} > 0 ? 'text-warning-amber' : 'text-red-500'}> {animatedRatingChange > 0 ? '+' : ''}{animatedRatingChange} Rating )} ); }