import { Heading } from '@/ui/Heading'; import { Icon } from '@/ui/Icon'; import { Image } from '@/ui/Image'; import { PlaceholderImage } from '@/ui/PlaceholderImage'; import { Stack } from '@/ui/primitives/Stack'; import { Text } from '@/ui/Text'; import { Calendar as LucideCalendar, ChevronRight as LucideChevronRight } from 'lucide-react'; import { ReactNode } from 'react'; 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: _isTeamLeague, usedDriverSlots: _usedDriverSlots, maxDrivers: _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 ? 'warning-amber' : fillPercentage >= 70 ? 'primary-accent' : 'success-green' } style={{ width: `${Math.min(fillPercentage, 100)}%` }} /> {/* Open Slots Badge */} {hasOpenSlots && ( {openSlotsCount} OPEN )} {/* Spacer to push footer to bottom */} {/* Footer Info */} {timingSummary && ( {timingSummary.split('•')[1]?.trim() || timingSummary} )} {/* View Arrow */} VIEW ); }