

import type { DriverViewModel } from '@/lib/view-models/DriverViewModel';
import { DriverRatingPill } from '@/components/drivers/DriverRatingPill';
import { DriverSummaryPill as UiDriverSummaryPill } from '@/components/drivers/DriverSummaryPill';

export interface DriverSummaryPillProps {
  driver: DriverViewModel;
  rating: number | null;
  rank: number | null;
  avatarSrc?: string | null;
  onClick?: () => void;
  href?: string;
}

export function DriverSummaryPill(props: DriverSummaryPillProps) {
  const { driver, rating, rank, avatarSrc, onClick, href } = props;

  return (
    <UiDriverSummaryPill
      name={driver.name}
      avatarSrc={avatarSrc}
      onClick={onClick}
      href={href}
      ratingComponent={<DriverRatingPill rating={rating} rank={rank} />}
    />
  );
}
