import { format } from "date-fns"; import { Link } from "react-router"; import { Badge } from "~/components/ui/badge"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "~/components/ui/card"; import { Trophy, Target, Flag, Calendar, Users } from "lucide-react"; import { formatEventDate } from "~/lib/date-utils"; import type { UpcomingParticipantEvent } from "~/models/scoring-event"; import { SportIcon } from "~/components/SportIcon"; interface SportSeasonCardProps { leagueId: string; sportSeasonId: string; sportName: string; sportIconUrl?: string | null; seasonName: string; status: "upcoming" | "active" | "completed"; scoringPattern?: string | null; upcomingParticipantEvents?: UpcomingParticipantEvent[]; } const MAX_EVENTS_SHOWN = 3; function EventLine({ event }: { event: UpcomingParticipantEvent }) { const gameDate = event.earliestGameTime ? new Date(event.earliestGameTime) : null; const dateStr = gameDate ? format(gameDate, "MMM d") : formatEventDate(event.eventDate); const isAllCompete = event.eventType !== "playoff_game"; const count = event.relevantParticipants.length; const displayName = event.matchLabel ? `${event.name} — ${event.matchLabel}` : event.name; return (
+{overflowCount} more event{overflowCount > 1 ? "s" : ""}
)}