import { ChevronRight } from 'lucide-react';
import { Box } from './Box';
import { Card } from './Card';
import { Icon } from './Icon';
import { Link } from './Link';
import { Stack } from './Stack';
import { Text } from './Text';
interface RaceResultCardProps {
raceId: string;
track: string;
car: string;
scheduledAt: string | Date;
position: number;
startPosition: number;
incidents: number;
leagueName?: string;
showLeague?: boolean;
onClick?: () => void;
}
export function RaceResultCard({
raceId,
track,
car,
scheduledAt,
position,
startPosition,
incidents,
leagueName,
showLeague = true,
onClick,
}: RaceResultCardProps) {
const getPositionColor = (pos: number) => {
if (pos === 1) return 'text-yellow-400 bg-yellow-400/20';
if (pos === 2) return 'text-gray-300 bg-gray-400/20';
if (pos === 3) return 'text-amber-600 bg-amber-600/20';
return 'text-gray-400 bg-charcoal-outline';
};
return (
P{position}
{track}
{car}
{new Date(scheduledAt).toLocaleDateString('en-US', {
month: 'short',
day: 'numeric',
year: 'numeric',
})}
{showLeague && leagueName && (
{leagueName}
)}
Started P{startPosition}
•
2 ? 'text-error-red' : undefined}>
{incidents}x incidents
{position < startPosition && (
<>
•
+{startPosition - position} positions
>
)}
);
}