Files
gridpilot.gg/apps/website/components/races/RaceResultCardWrapper.tsx
2026-01-24 01:07:43 +01:00

43 lines
1.0 KiB
TypeScript

import { DateFormatter } from '@/lib/formatters/DateFormatter';
import { RaceResultViewModel } from '@/lib/view-models/RaceResultViewModel';
import { RaceResultCard as UiRaceResultCard } from './RaceResultCard';
interface RaceResultCardProps {
race: {
id: string;
track: string;
car: string;
scheduledAt: string;
};
result: RaceResultViewModel;
league?: {
name: string;
};
showLeague?: boolean;
}
export function RaceResultCard({
race,
result,
league,
showLeague = true,
}: RaceResultCardProps) {
return (
<UiRaceResultCard
raceId={race.id}
track={race.track}
car={race.car}
formattedDate={DateFormatter.formatShort(race.scheduledAt)}
position={result.position}
positionLabel={result.formattedPosition}
startPositionLabel={result.formattedStartPosition}
incidentsLabel={result.formattedIncidents}
positionsGainedLabel={result.formattedPositionsGained}
leagueName={league?.name}
showLeague={showLeague}
/>
);
}