import Link from 'next/link'; import Image from 'next/image'; import type { DriverDTO } from '@gridpilot/racing/application/dto/DriverDTO'; import { getImageService } from '@/lib/di-container'; export interface DriverIdentityProps { driver: DriverDTO; href?: string; contextLabel?: React.ReactNode; meta?: React.ReactNode; size?: 'sm' | 'md'; } export default function DriverIdentity(props: DriverIdentityProps) { const { driver, href, contextLabel, meta, size = 'md' } = props; const avatarSize = size === 'sm' ? 40 : 48; const nameTextClasses = size === 'sm' ? 'text-sm font-medium text-white' : 'text-base md:text-lg font-semibold text-white'; const metaTextClasses = 'text-xs md:text-sm text-gray-400'; const content = (
{driver.name}
{driver.name} {contextLabel ? ( {contextLabel} ) : null}
{meta ?
{meta}
: null}
); if (href) { return ( {content} ); } return
{content}
; }