import { Shield } from "lucide-react"; import { Link } from "react-router"; import { Card, CardContent } from "~/components/ui/card"; import { SectionCardHeader } from "~/components/ui/SectionCardHeader"; import { LeagueRow, type LeagueRowProps } from "./LeagueRow"; const STATUS_ORDER: Record = { draft: 0, active: 1, pre_draft: 2, completed: 3, }; interface MyLeaguesCardProps { leagues: LeagueRowProps[]; viewAllUrl?: string; } export function MyLeaguesCard({ leagues, viewAllUrl }: MyLeaguesCardProps) { const sorted = leagues.toSorted( (a, b) => STATUS_ORDER[a.status] - STATUS_ORDER[b.status] ); const right = viewAllUrl ? ( View All Leagues ) : undefined; return ( {sorted.length === 0 ? (

You aren't a member of any leagues yet.

Create your first league →
) : (
{sorted.map((league) => ( ))}
)}
); }