import { ReactNode } from 'react'; import { Box } from './Box'; import { Heading } from './Heading'; import { Icon } from './Icon'; import { Text } from './Text'; interface LeagueCardProps { name: string; description?: string; coverUrl: string; logoUrl?: string; badges?: ReactNode; championshipBadge?: ReactNode; slotLabel: string; usedSlots: number; maxSlots: number | string; fillPercentage: number; hasOpenSlots: boolean; openSlotsCount: number; isTeamLeague?: boolean; usedDriverSlots?: number; maxDrivers?: number | string; timingSummary?: string; onClick?: () => void; } export function LeagueCard({ name, description, coverUrl, logoUrl, badges, championshipBadge, slotLabel, usedSlots, maxSlots, fillPercentage, hasOpenSlots, openSlotsCount, isTeamLeague, usedDriverSlots, maxDrivers, timingSummary, onClick, }: LeagueCardProps) { return ( {/* Card Container */} {/* Cover Image */} {`${name} {/* Gradient Overlay */} {/* Badges - Top Left */} {badges} {/* Championship Type Badge - Top Right */} {championshipBadge} {/* Logo */} {logoUrl ? ( {`${name} ) : ( )} {/* Content */} {/* Title & Description */} {name} {description || 'No description available'} {/* Stats Row */} {/* Primary Slots (Drivers/Teams/Nations) */} {slotLabel} {usedSlots}/{maxSlots || '∞'} = 90 ? 'bg-warning-amber' : fillPercentage >= 70 ? 'bg-primary-blue' : 'bg-performance-green' } style={{ width: `${Math.min(fillPercentage, 100)}%` }} /> {/* Open Slots Badge */} {hasOpenSlots && ( {openSlotsCount} open )} {/* Driver count for team leagues */} {isTeamLeague && ( {usedDriverSlots ?? 0}/{maxDrivers ?? '∞'} drivers )} {/* Spacer to push footer to bottom */} {/* Footer Info */} {timingSummary && ( {timingSummary.split('•')[1]?.trim() || timingSummary} )} {/* View Arrow */} View ); } import { Calendar as LucideCalendar, ChevronRight as LucideChevronRight, Users as LucideUsers } from 'lucide-react';