mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-04-20 06:28:14 -04:00
* mostly there * native opening working * more * cleanup * reorganise * remove unnecessary import * uncomment some stuff * spacing * store quickview ref inside provider * fix linting * clippy --------- Co-authored-by: Utku <74243531+utkubakir@users.noreply.github.com> Co-authored-by: Jamie Pine <32987599+jamiepine@users.noreply.github.com>
17 lines
528 B
TypeScript
17 lines
528 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 = (selectedItem: ExplorerItem | null, location_id: number | null) => {
|
|
return useKey('Delete', (e) => {
|
|
e.preventDefault();
|
|
|
|
if (!selectedItem || !location_id) return;
|
|
|
|
dialogManager.create((dp) => (
|
|
<DeleteDialog {...dp} location_id={location_id} path_id={selectedItem.item.id} />
|
|
));
|
|
});
|
|
};
|