import { DriversTemplate } from '@/templates/DriversTemplate';
import { DriverLeaderboardItemViewModel } from '@/lib/view-models/DriverLeaderboardItemViewModel';
import { DriverLeaderboardViewModel } from '@/lib/view-models/DriverLeaderboardViewModel';

interface DriversStaticProps {
  leaderboardData: DriverLeaderboardViewModel;
}

export async function DriversStatic({ leaderboardData }: DriversStaticProps) {
  // Transform the data for the template
  const drivers = leaderboardData.drivers.map((driver, index) => 
    new DriverLeaderboardItemViewModel(driver, index + 1)
  );

  return (
    <DriversTemplate
      drivers={drivers}
      totalRaces={leaderboardData.totalRaces}
      totalWins={leaderboardData.totalWins}
      activeCount={leaderboardData.activeCount}
      isLoading={false}
    />
  );
}