'use client'; import React from 'react'; import Image from 'next/image'; import Link from 'next/link'; import type { DriverViewModel } from '@/lib/view-models/DriverViewModel'; import DriverRating from '@/components/profile/DriverRatingPill'; import PlaceholderImage from '@/components/ui/PlaceholderImage'; export interface DriverSummaryPillProps { driver: DriverViewModel; rating: number | null; rank: number | null; avatarSrc?: string | null; onClick?: () => void; href?: string; } export default function DriverSummaryPill(props: DriverSummaryPillProps) { const { driver, rating, rank, avatarSrc, onClick, href } = props; const resolvedAvatar = avatarSrc; const content = ( <>
{resolvedAvatar ? ( {driver.name} ) : ( )}
{driver.name}
); if (href) { return ( {content} ); } if (onClick) { return ( ); } return (
{content}
); }