'use client'; import React from 'react'; import { Trophy } from 'lucide-react'; import { Surface } from '@/ui/Surface'; import { Stack } from '@/ui/Stack'; import { Box } from '@/ui/Box'; import { Text } from '@/ui/Text'; import { DecorativeBlur } from '@/ui/DecorativeBlur'; interface RaceUserResultProps { position: number; startPosition: number; positionChange: number; incidents: number; isClean: boolean; isPodium: boolean; ratingChange?: number; animatedRatingChange: number; } export function RaceUserResult({ position, startPosition, positionChange, incidents, isClean, isPodium, ratingChange, animatedRatingChange, }: RaceUserResultProps) { return ( {position === 1 && ( )} P{position} {position === 1 ? '🏆 VICTORY!' : position === 2 ? '🥈 Second Place' : position === 3 ? '🥉 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 ? '#10b981' : '#ef4444' }}> {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 ? '#f59e0b' : '#ef4444' }}> {animatedRatingChange > 0 ? '+' : ''}{animatedRatingChange} Rating )} ); }