diff --git a/app/components/MapPoolSelector.tsx b/app/components/MapPoolSelector.tsx index 66b9f1e19..25df62486 100644 --- a/app/components/MapPoolSelector.tsx +++ b/app/components/MapPoolSelector.tsx @@ -31,10 +31,11 @@ export type MapPoolSelectorProps = { recentEvents?: SerializedMapPoolEvent[]; initialEvent?: Pick; title?: string; - noTitle?: boolean; modesToInclude?: ModeShort[]; info?: React.ReactNode; footer?: React.ReactNode; + /** Enables clear button, template selection, and toggling a whole stage */ + allowBulkEdit?: boolean; }; export function MapPoolSelector({ @@ -46,10 +47,10 @@ export function MapPoolSelector({ recentEvents, initialEvent, title, - noTitle = false, modesToInclude, info, footer, + allowBulkEdit = false, }: MapPoolSelectorProps) { const { t } = useTranslation(); @@ -111,29 +112,29 @@ export function MapPoolSelector({ assertType(); }; - const includeFancyControls = Boolean(recentEvents); - return (
- {!noTitle && {title ?? t("maps.mapPool")}} - {includeFancyControls && ( + {Boolean(title) && {title}} + {Boolean(handleRemoval || allowBulkEdit) && (
{handleRemoval && ( )} - + {allowBulkEdit && ( + + )}
)}
- {includeFancyControls && ( + {allowBulkEdit && (
@@ -165,7 +166,7 @@ export function MapPoolSelector({ export type MapPoolStagesProps = { mapPool: MapPool; handleMapPoolChange?: (newMapPool: MapPool) => void; - includeFancyControls?: boolean; + allowBulkEdit?: boolean; modesToInclude?: ModeShort[]; preselectedMapPool?: MapPool; }; @@ -173,7 +174,7 @@ export type MapPoolStagesProps = { export function MapPoolStages({ mapPool, handleMapPoolChange, - includeFancyControls = true, + allowBulkEdit = false, modesToInclude, preselectedMapPool, }: MapPoolStagesProps) { @@ -313,7 +314,7 @@ export function MapPoolStages({ ); })} {!isPresentational && - includeFancyControls && + allowBulkEdit && (mapPool.hasStage(stageId) ? (