import { Button } from "~/components/ui/button"; import { Badge } from "~/components/ui/badge"; import { AutodraftSettings } from "~/components/AutodraftSettings"; interface QueueSectionProps { queue: Array<{ id: string; participantId: string; }>; availableParticipants: Array<{ id: string; name: string; }>; eligibility: { flexPicksUsed: number; flexPicksAvailable: number; picksBySport: Record; sportAvailability: Record< string, { sportName: string; sportId: string } >; ineligibleReasons: Record; } | null; seasonId: string; teamId: string; isMyTurn: boolean; userAutodraft: { isEnabled: boolean; mode: "next_pick" | "while_on"; }; onClearQueue: () => void; onRemoveFromQueue: (queueId: string) => void; onAutodraftUpdate: (isEnabled: boolean, mode: "next_pick" | "while_on") => void; } export function QueueSection({ queue, availableParticipants, eligibility, seasonId, teamId, isMyTurn, userAutodraft, onClearQueue, onRemoveFromQueue, onAutodraftUpdate, }: QueueSectionProps) { return (

Queue ({queue.length})

{queue.length > 0 && ( )}
{/* Eligibility Status Banner */} {eligibility && (
Draft Status
Flex Picks: = eligibility.flexPicksAvailable ? "text-red-600 dark:text-red-400 font-semibold" : "text-green-600 dark:text-green-400" } > {eligibility.flexPicksUsed} / {eligibility.flexPicksAvailable}
{Object.entries(eligibility.picksBySport).length > 0 && ( <>
Picks by Sport:
{Object.entries(eligibility.picksBySport).map( ([sportId, count]) => { const sportInfo = eligibility.sportAvailability[sportId]; return (
{sportInfo?.sportName || sportId}: {count}
); } )} )} {Object.keys(eligibility.ineligibleReasons).length > 0 && ( <>
Restrictions:
{Object.entries(eligibility.ineligibleReasons) .slice(0, 2) .map(([sportId, reason]) => { const sportInfo = eligibility.sportAvailability[sportId]; return (
{sportInfo?.sportName}: {reason}
); })} )}
)} {/* Queue List */} {queue.length === 0 ? (

Click participants to add to your queue

) : (
{queue.map((item, index) => (
{index + 1}

{availableParticipants.find( (p) => p.id === item.participantId )?.name || "Unknown"}

))}
)} {/* Autodraft Settings */}
); }