import React from "react"; import type { Event } from "../../../services/api/types"; import type { ParticipantListRecord } from "../../../services/api/participantLists"; export type BulkDialogKind = null | "addTags" | "removeTags" | "assignEvents" | "newList" | "addToList"; export function ParticipantBulkDialogs({ bulkDialog, bulkBusy, selectedCount, tagBulkInput, onTagBulkInputChange, newListName, onNewListNameChange, newListDesc, onNewListDescChange, eventsPick, eventPickIds, onToggleEventPick, fixedLists, addToListId, onAddToListIdChange, onClose, onApplyTags, onAssignEvents, onCreateList, onAddToList, }: { bulkDialog: BulkDialogKind; bulkBusy: boolean; selectedCount: number; tagBulkInput: string; onTagBulkInputChange: (v: string) => void; newListName: string; onNewListNameChange: (v: string) => void; newListDesc: string; onNewListDescChange: (v: string) => void; eventsPick: Event[]; eventPickIds: Set; onToggleEventPick: (id: string) => void; fixedLists: ParticipantListRecord[]; addToListId: string; onAddToListIdChange: (id: string) => void; onClose: () => void; onApplyTags: (action: "add_tags" | "remove_tags") => void; onAssignEvents: () => void; onCreateList: () => void; onAddToList: () => void; }) { const overlay = (children: React.ReactNode) => (
!bulkBusy && onClose()} >
e.stopPropagation()} > {children}
); const footer = (primary: React.ReactNode) => (
{primary}
); if (bulkDialog === "addTags" || bulkDialog === "removeTags") { return overlay( <>

{bulkDialog === "addTags" ? "Add tags" : "Remove tags"}

Apply to {selectedCount} selected (comma-separated).

onTagBulkInputChange(e.target.value)} placeholder="e.g. VIP, Sponsor" style={{ width: "100%", padding: "8px 12px", borderRadius: "var(--radius-button)", border: "1px solid var(--border)", fontSize: "var(--text-sm)", boxSizing: "border-box" }} /> {footer( )} ); } if (bulkDialog === "assignEvents") { return overlay( <>

Assign to event(s)

{selectedCount} people ยท adds pending membership where missing.

{eventsPick.map((ev) => ( ))}
{footer( )} ); } if (bulkDialog === "newList") { return overlay( <>

New custom list

Fixed list with {selectedCount} selected people.

onNewListNameChange(e.target.value)} placeholder="List name" style={{ width: "100%", padding: "8px 12px", borderRadius: "var(--radius-button)", border: "1px solid var(--border)", marginBottom: "8px", boxSizing: "border-box", fontSize: "var(--text-sm)" }} />