import React from 'react'; import { Box } from '@/ui/Box'; import { Image } from '@/ui/Image'; import { Link } from '@/ui/Link'; import { PlaceholderImage } from '@/ui/PlaceholderImage'; import { Stack } from '@/ui/Stack'; import { Text } from '@/ui/Text'; interface DriverSummaryPillProps { name: string; avatarSrc?: string | null; rating?: number | null; rank?: number | null; onClick?: () => void; href?: string; ratingComponent?: React.ReactNode; } export function DriverSummaryPill({ name, avatarSrc, onClick, href, ratingComponent, }: DriverSummaryPillProps) { const content = ( <> {avatarSrc ? ( {name} ) : ( )} {name} {ratingComponent} ); if (href) { return ( {content} ); } if (onClick) { return ( {content} ); } return ( {content} ); }