mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-10-23 01:24:36 -04:00
* Generalizing filesystem jobs to accept multiple files at once * Some small changes and fixing front * Enable rename route to replicate Finder's behavior * Assign tag to multiple objects at once * Remove from recents accepting multiple files * Fixing some warnings * Adding multiple files feature to Open and Open With * Conditional stuff for macos * Generating commands.ts and other minor warnings * Rust fmt * TS typecheck * Rust format and TS typecheck * Requested changes * Requested changes --------- Co-authored-by: Utku <74243531+utkubakir@users.noreply.github.com>
39 lines
985 B
TypeScript
39 lines
985 B
TypeScript
import { useLibraryMutation } from '@sd/client';
|
|
import { CheckBox, Dialog, Tooltip, UseDialogProps, useDialog } from '@sd/ui';
|
|
import { useZodForm } from '@sd/ui/src/forms';
|
|
|
|
interface Propps extends UseDialogProps {
|
|
location_id: number;
|
|
path_id: number;
|
|
}
|
|
|
|
export default (props: Propps) => {
|
|
const deleteFile = useLibraryMutation('files.deleteFiles');
|
|
|
|
const form = useZodForm();
|
|
|
|
return (
|
|
<Dialog
|
|
form={form}
|
|
onSubmit={form.handleSubmit(() =>
|
|
deleteFile.mutateAsync({
|
|
location_id: props.location_id,
|
|
file_path_ids: [props.path_id]
|
|
})
|
|
)}
|
|
dialog={useDialog(props)}
|
|
title="Delete a file"
|
|
description="Configure your deletion settings."
|
|
loading={deleteFile.isLoading}
|
|
ctaLabel="Delete"
|
|
>
|
|
<Tooltip label="Coming soon">
|
|
<div className="flex items-center opacity-50">
|
|
<CheckBox disabled className="!mt-0" />
|
|
<p className="text-sm text-ink-faint">Delete all matching files</p>
|
|
</div>
|
|
</Tooltip>
|
|
</Dialog>
|
|
);
|
|
};
|