From 9e0e522352fa43ac2a0afe9ff718551444d63e75 Mon Sep 17 00:00:00 2001 From: FTCHD <144691102+FTCHD@users.noreply.github.com> Date: Mon, 11 May 2026 11:55:34 +0300 Subject: [PATCH] handle allowMultiple properlu --- src/components/PathSelector.tsx | 164 ++++++++++++++++++-------------- 1 file changed, 91 insertions(+), 73 deletions(-) diff --git a/src/components/PathSelector.tsx b/src/components/PathSelector.tsx index a8a68f0..3f1985d 100644 --- a/src/components/PathSelector.tsx +++ b/src/components/PathSelector.tsx @@ -86,90 +86,108 @@ export default function PathSelector({ [buttons.BackButton, buttons.RefreshButton], [ buttons.SearchInput, - - - } - className="gap-0.5 min-w-fit" - > - SELECT - - - - - Current Folder ( - {currentPath.split(RE_PATH_SEPARATOR).pop() || currentRemote || 'root'}) - - panelRef.current?.selectAll('files')} - > - All Files - - panelRef.current?.selectAll('folders')} - > - All Folders - - panelRef.current?.selectAll('all')} - > - All Files & Folders - - panelRef.current?.clearSelection()} - color="danger" - > - Deselect All - - - , + ...(allowMultiple + ? [ + + + } + className="gap-0.5 min-w-fit" + > + SELECT + + + + + Current Folder ( + {currentPath.split(RE_PATH_SEPARATOR).pop() || + currentRemote || + 'root'} + ) + + panelRef.current?.selectAll('files')} + > + All Files + + panelRef.current?.selectAll('folders')} + > + All Folders + + panelRef.current?.selectAll('all')} + > + All Files & Folders + + panelRef.current?.clearSelection()} + color="danger" + > + Deselect All + + + , + ] + : []), - + DISMISS , ], [ - 0} - > - - - {selectedCount === 0 - ? '0 SELECTED' - : allowMultiple - ? `PICK (${selectedCount})` - : 'PICK'} - - - , + allowMultiple ? ( + 0} + > + + + {selectedCount === 0 ? '0 SELECTED' : `PICK (${selectedCount})`} + + + + ) : ( + + {selectedCount === 0 ? 'PICK CURRENT FOLDER' : 'PICK'} + + ), ], ], [