import { DateFormatter } from '@/lib/formatters/DateFormatter'; import { DriverViewModel } from '@/lib/view-models/DriverViewModel'; import { Badge } from '@/ui/Badge'; import { Box } from '@/ui/Box'; import { DriverIdentity } from '@/ui/DriverIdentity'; import { TableCell, TableRow } from '@/ui/Table'; import { Text } from '@/ui/Text'; import { ReactNode } from 'react'; interface LeagueMemberRowProps { driver?: DriverViewModel; driverId: string; isCurrentUser: boolean; isTopPerformer: boolean; role: string; roleVariant: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info'; joinedAt: string | Date; rating?: number | string; rank?: number | string; wins?: number; actions?: ReactNode; href: string; meta?: string | null; } export function LeagueMemberRow({ driver, isCurrentUser, isTopPerformer, role, roleVariant, joinedAt, rating, rank, wins, actions, href, meta, }: LeagueMemberRowProps) { const roleLabel = role.charAt(0).toUpperCase() + role.slice(1); return ( {driver ? ( ) : ( Unknown Driver )} {isCurrentUser && ( (You) )} {isTopPerformer && ( )} {rating || '—'} #{rank || '—'} {wins || 0} {roleLabel} {DateFormatter.formatShort(joinedAt)} {actions && ( {actions} )} ); }