"use client"; import type { ReactNode } from "react"; import { ClipboardCheckIcon, FileClockIcon, GavelIcon, SendIcon } from "lucide-react"; import type { LucideIcon } from "lucide-react"; import { Alert, AlertDescription } from "@/components/ui/alert"; import { Badge } from "@/components/ui/badge"; import { NominationCard, type NominationCardActions, } from "@/components/frontend/promotions/NominationCard"; import type { NominationView } from "@/components/frontend/promotions/nominationTypes"; interface PromotionsViewProps { readonly isSuperuserViewer: boolean; readonly isLeader: boolean; readonly leaderQueue: readonly NominationView[]; readonly finalQueue: readonly NominationView[]; readonly mySubmissions: readonly NominationView[]; readonly recentlyResolved: readonly NominationView[]; } function NominationSection({ icon: Icon, title, count, children, }: { readonly icon: LucideIcon; readonly title: string; readonly count: number; readonly children: ReactNode; }) { return (
{children}
); } function EmptyNominationSection({ message }: { readonly message: string }) { return ( {message} ); } function NominationGrid({ nominations, actionFor, }: { readonly nominations: readonly NominationView[]; readonly actionFor: (nomination: NominationView) => NominationCardActions; }) { return (
{nominations.map((nomination) => ( ))}
); } export function PromotionsView({ isSuperuserViewer, isLeader, leaderQueue, finalQueue, mySubmissions, recentlyResolved, }: PromotionsViewProps) { return (
{isLeader && ( {leaderQueue.length === 0 ? ( ) : ( "leader"} /> )} )} {isSuperuserViewer && ( {finalQueue.length === 0 ? ( ) : ( "final"} /> )} )} {mySubmissions.length === 0 ? ( ) : ( (nomination.status === "pending" ? "withdraw" : "none")} /> )} {(isSuperuserViewer || isLeader) && ( {recentlyResolved.length === 0 ? ( ) : ( "none"} /> )} )}
); }