'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 '@/ui/PlaceholderImage'; import { Box } from '@/ui/Box'; import { Stack } from '@/ui/Stack'; import { Text } from '@/ui/Text'; 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; const resolvedAvatar = avatarSrc; const content = ( <> {resolvedAvatar ? ( {driver.name} ) : ( )} {driver.name} ); const baseClasses = "flex items-center gap-3 rounded-full bg-iron-gray/70 px-3 py-1.5 border border-charcoal-outline/80 shadow-[0_0_18px_rgba(0,0,0,0.45)] hover:border-primary-blue/60 hover:bg-iron-gray transition-colors"; if (href) { return ( {content} ); } if (onClick) { return ( ); } return ( {content} ); }