'use client'; import Link from 'next/link'; import Image from 'next/image'; import type { LeagueDTO } from '@gridpilot/racing/application/dto/LeagueDTO'; import Card from '../ui/Card'; import { getLeagueCoverClasses } from '@/lib/leagueCovers'; import { getImageService } from '@/lib/di-container'; interface LeagueCardProps { league: LeagueDTO; onClick?: () => void; } export default function LeagueCard({ league, onClick }: LeagueCardProps) { const imageService = getImageService(); const coverUrl = imageService.getLeagueCover(league.id); const logoUrl = imageService.getLeagueLogo(league.id); return (

{league.name}

{new Date(league.createdAt).toLocaleDateString()}

{league.description}

Owner:{' '} {league.ownerId.slice(0, 8)}... Slots:{' '} {typeof league.usedSlots === 'number' ? league.usedSlots : '—'} {' / '} {league.settings.maxDrivers ?? '—'} {' '} used
{league.settings.pointsSystem.toUpperCase()}
); }