// import { // Algorithm, // hashingAlgoSlugSchema, // slugFromHashingAlgo, // useLibraryMutation, // useLibraryQuery // } from '@sd/client'; // import { Button, Dialog, Select, SelectOption, UseDialogProps, useDialog } from '@sd/ui'; // import { CheckBox, useZodForm, z } from '@sd/ui/src/forms'; // import { showAlertDialog } from '~/components'; // import { usePlatform } from '~/util/Platform'; // import { KeyListSelectOptions } from '../../KeyManager/List'; // interface Props extends UseDialogProps { // location_id: number; // path_id: number; // } // const schema = z.object({ // key: z.string(), // encryptionAlgo: z.string(), // hashingAlgo: hashingAlgoSlugSchema, // metadata: z.boolean(), // previewMedia: z.boolean(), // outputPath: z.string() // }); // export default (props: Props) => { // const platform = usePlatform(); // const UpdateKey = (uuid: string) => { // form.setValue('key', uuid); // const hashAlg = keys.data?.find((key) => { // return key.uuid === uuid; // })?.hashing_algorithm; // hashAlg && form.setValue('hashingAlgo', slugFromHashingAlgo(hashAlg)); // }; // const keys = useLibraryQuery(['keys.list']); // const mountedUuids = useLibraryQuery(['keys.listMounted'], { // onSuccess: (data) => { // UpdateKey(data[0] ?? ''); // } // }); // const encryptFile = useLibraryMutation('files.encryptFiles', { // onSuccess: () => { // showAlertDialog({ // title: 'Success', // value: 'The encryption job has started successfully. You may track the progress in the job overview panel.' // }); // }, // onError: () => { // showAlertDialog({ // title: 'Error', // value: 'The encryption job failed to start.' // }); // } // }); // const form = useZodForm({ // defaultValues: { encryptionAlgo: 'XChaCha20Poly1305', outputPath: '' }, // schema // }); // return ( // // encryptFile.mutateAsync({ // algorithm: data.encryptionAlgo as Algorithm, // key_uuid: data.key, // location_id: props.location_id, // file_path_ids: [props.path_id], // metadata: data.metadata, // preview_media: data.previewMedia // }) // )} // dialog={useDialog(props)} // title="Encrypt a file" // description="Configure your encryption settings. Leave the output file blank for the default." // loading={encryptFile.isLoading} // ctaLabel="Encrypt" // > //
//
// Key // //
//
// Output file // //
//
//
//
// Encryption // //
//
// Hashing // //
//
//
//
// Metadata // //
//
// Preview Media // //
//
//
// ); // };