import { Trophy } from "lucide-react"; import { Input } from "~/components/ui/input"; import { Label } from "~/components/ui/label"; import { Button } from "~/components/ui/button"; import { StepperInput } from "~/components/league/StepperInput"; import { SettingsSection, SettingsStatusPill } from "./SettingsSection"; export function LeagueBasicsSection({ active, season, leagueName, onLeagueNameChange, isPublicDraftBoard, onIsPublicDraftBoardChange, teamCountValue, onTeamCountValueChange, teamsWithOwners, canEditTeamCount, minTeamCount, inviteUrl, copied, onCopyInviteLink, }: { active: boolean; season: { inviteCode: string | null } | null; leagueName: string; onLeagueNameChange: (v: string) => void; isPublicDraftBoard: boolean; onIsPublicDraftBoardChange: (v: boolean) => void; teamCountValue: number; onTeamCountValueChange: (v: number) => void; teamsWithOwners: number; canEditTeamCount: boolean; minTeamCount: number; inviteUrl: string; copied: boolean; onCopyInviteLink: () => void; }) { return ( Always editable} className={active ? undefined : "hidden"} >
onLeagueNameChange(e.target.value)} placeholder="Enter league name" required minLength={3} maxLength={50} />

Minimum {minTeamCount} based on teams with owners.

{!canEditTeamCount && (

Locked after the draft starts.

)}
{season?.inviteCode && (

Invite Link

{/* eslint-disable-next-line no-nested-ternary */} {(() => { const open = teamCountValue - teamsWithOwners; return open > 0 ? `${open} open spot${open === 1 ? "" : "s"} available.` : "No open team spots right now."; })()}

e.currentTarget.select()} className="text-sm" />
)}
); }