diff --git a/app/components/draft/AvailableParticipantsSection.tsx b/app/components/draft/AvailableParticipantsSection.tsx index 0f47df9..a3c3ce9 100644 --- a/app/components/draft/AvailableParticipantsSection.tsx +++ b/app/components/draft/AvailableParticipantsSection.tsx @@ -2,6 +2,24 @@ import { Button } from "~/components/ui/button"; import { Badge } from "~/components/ui/badge"; import { ListPlus, ListX } from "lucide-react"; +function getParticipantState( + participant: { id: string; sport: { id: string } }, + draftedParticipantIds: Set, + queue: Array<{ participantId: string }>, + eligibility: { + eligibleSportIds: Set; + ineligibleReasons: Record; + } | null +) { + const isDrafted = draftedParticipantIds.has(participant.id); + const isInQueue = queue.some((item) => item.participantId === participant.id); + const isEligible = eligibility + ? eligibility.eligibleSportIds.has(participant.sport.id) + : true; + const ineligibleReason = eligibility?.ineligibleReasons[participant.sport.id]; + return { isDrafted, isInQueue, isEligible, ineligibleReason }; +} + interface AvailableParticipantsSectionProps { participants: Array<{ id: string; @@ -66,12 +84,12 @@ export function AvailableParticipantsSection({ className="w-full px-3 py-2 border rounded-md text-sm bg-background text-foreground" /> -
+
{/* Sport Filter Dropdown */}