import React, { ReactNode } from 'react'; import { TableRow, TableCell } from './Table'; import { Box } from './Box'; import { Text } from './Text'; import { Badge } from './Badge'; import { DriverIdentity } from './DriverIdentity'; import { DriverViewModel } from '@/lib/view-models/DriverViewModel'; 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, driverId, 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} {new Date(joinedAt).toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric', })} {actions && ( {actions} )} ); }