import { ChevronRight, Users, Clock, Calendar, UserPlus, Heart } from 'lucide-react';
import { ReactNode } from 'react';
import { Box } from './Box';
import { Card } from './Card';
import { Icon } from './Icon';
import { Image } from './Image';
import { Text } from './Text';
import { Stack } from './Stack';
import { Group } from './Group';
import { Heading } from './Heading';
import { Button } from './Button';
import { Badge } from './Badge';
export interface LeagueCardProps {
name: string;
description?: string;
coverUrl: string;
logoUrl?: string;
slotLabel: string;
usedSlots: number;
maxSlots: number | string;
fillPercentage: number;
hasOpenSlots: boolean;
openSlotsCount: number;
isTeamLeague: boolean;
usedDriverSlots?: number;
maxDrivers?: number;
activeDriversCount?: number;
nextRaceAt?: string;
timingSummary?: string;
onClick?: () => void;
onQuickJoin?: (e: React.MouseEvent) => void;
onFollow?: (e: React.MouseEvent) => void;
badges?: ReactNode;
championshipBadge?: ReactNode;
isFeatured?: boolean;
}
export const LeagueCard = ({
name,
description,
coverUrl,
logoUrl,
slotLabel,
usedSlots,
maxSlots,
fillPercentage,
hasOpenSlots,
openSlotsCount,
isTeamLeague,
usedDriverSlots,
maxDrivers,
activeDriversCount,
nextRaceAt,
timingSummary,
onClick,
onQuickJoin,
onFollow,
badges,
championshipBadge,
isFeatured
}: LeagueCardProps) => {
return (
{isFeatured && (
FEATURED
)}
{badges}
{logoUrl ? (
) : (
)}
{name}
{championshipBadge}
{description && (
{description}
)}
{nextRaceAt && (
Next: {new Date(nextRaceAt).toLocaleDateString()} {new Date(nextRaceAt).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}
)}
{activeDriversCount !== undefined && activeDriversCount > 0 && (
{activeDriversCount} Active Drivers
)}
{slotLabel}
{usedSlots} / {maxSlots}
{onQuickJoin && (
)}
{onFollow && (
)}
{timingSummary || 'Schedule TBD'}
);
};
export interface LeagueCardStatsProps {
label: string;
value: string;
percentage: number;
intent?: 'primary' | 'success' | 'warning' | 'telemetry';
}
export const LeagueCardStats = ({ label, value, percentage, intent = 'primary' }: LeagueCardStatsProps) => {
const intentColors = {
primary: 'var(--ui-color-intent-primary)',
success: 'var(--ui-color-intent-success)',
warning: 'var(--ui-color-intent-warning)',
telemetry: 'var(--ui-color-intent-telemetry)',
};
return (
{label}
{value}
);
};
export interface LeagueCardFooterProps {
children: ReactNode;
}
export const LeagueCardFooter = ({ children }: LeagueCardFooterProps) => (
{children}
ACCESS
);