'use client';
import { routes } from '@/lib/routing/RouteConfig';
import { Card } from '@/ui/Card';
import { Icon } from '@/ui/Icon';
import { Link } from '@/ui/Link';
import { Stack } from '@/ui/Stack';
import { Text } from '@/ui/Text';
import { ChevronRight } from 'lucide-react';
interface RaceResultCardProps {
raceId: string;
track: string;
car: string;
formattedDate: string;
position: number;
positionLabel: string;
startPositionLabel: string;
incidentsLabel: string;
positionsGainedLabel?: string;
leagueName?: string;
showLeague?: boolean;
onClick?: () => void;
}
export function RaceResultCard({
raceId,
track,
car,
formattedDate,
position,
positionLabel,
startPositionLabel,
incidentsLabel,
positionsGainedLabel,
leagueName,
showLeague = true,
onClick,
}: RaceResultCardProps) {
const getPositionStyles = (pos: number) => {
if (pos === 1) return { color: 'text-warning-amber', bg: 'bg-warning-amber', bgOpacity: 0.2 };
if (pos === 2) return { color: 'text-gray-300', bg: 'bg-gray-400', bgOpacity: 0.2 };
if (pos === 3) return { color: 'text-amber-600', bg: 'bg-amber-600', bgOpacity: 0.2 };
return { color: 'text-gray-400', bg: 'bg-base-black', bgOpacity: 0.5 };
};
const positionStyles = getPositionStyles(position);
return (
{positionLabel}
{track}
{car}
{formattedDate}
{showLeague && leagueName && (
{leagueName}
)}
Started {startPositionLabel}
•
{incidentsLabel}
{positionsGainedLabel && (
<>
•
{positionsGainedLabel}
>
)}
);
}