mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-02-20 07:37:26 -05:00
* grid * Improved multi-select, grid list & view offset. Added gap option & app frame. * List view multi-select * Include multi-select in overview, fix page ref type * Add gap to options panel * Fix drag * Update categories z-index * going pretty well * fix a couple bugs * fix another bug :) * minor improvements * Separate grid activeItem * extra comments * um akshully don't ref during render * show thumbnails yay * cleanup * Clean up * Fix ranges * here it is * fix cols drag * don't enforce selecto context * explorer view selectable * Update index.tsx * Context menu support for multi-select (#1187) * here it is * stopPropagation * cut copy multiple --------- Co-authored-by: nikec <nikec.job@gmail.com> * explorer view selectable * Update index.tsx * items Map * fix renamable * Update inspector * Hide tag assign if empty * fix merge * cleanup * fix un-rendered drag select * fix double click quick preview * update thumbnail * mostly handle multiple select in keybindings * fix ts * remove another todo * move useItemAs hooks to @sd/client * fix thumb controls * multi-select double click * cleaner? * smaller gap --------- Co-authored-by: Jamie Pine <ijamespine@me.com> Co-authored-by: Brendan Allan <brendonovich@outlook.com> Co-authored-by: Jamie Pine <32987599+jamiepine@users.noreply.github.com> Co-authored-by: Utku <74243531+utkubakir@users.noreply.github.com> Co-authored-by: Ericson "Fogo" Soares <ericson.ds999@gmail.com>
23 lines
627 B
TypeScript
23 lines
627 B
TypeScript
import { useKey } from 'rooks';
|
|
import { ExplorerItem } from '@sd/client';
|
|
import { dialogManager } from '@sd/ui';
|
|
import DeleteDialog from '~/app/$libraryId/Explorer/FilePath/DeleteDialog';
|
|
|
|
export const useKeyDeleteFile = (selectedItems: Set<ExplorerItem>, locationId?: number | null) => {
|
|
return useKey('Delete', (e) => {
|
|
e.preventDefault();
|
|
|
|
if (!locationId) return;
|
|
|
|
const pathIds: number[] = [];
|
|
|
|
for (const item of selectedItems) {
|
|
if (item.type === 'Path') pathIds.push(item.item.id);
|
|
}
|
|
|
|
dialogManager.create((dp) => (
|
|
<DeleteDialog {...dp} locationId={locationId} pathIds={pathIds} />
|
|
));
|
|
});
|
|
};
|