

import { RaceResultViewModel } from '@/lib/view-models/RaceResultViewModel';
import { RaceResultCard as UiRaceResultCard } from '@/ui/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}
      scheduledAt={race.scheduledAt}
      position={result.position}
      startPosition={result.startPosition}
      incidents={result.incidents}
      leagueName={league?.name}
      showLeague={showLeague}
    />
  );
}
