Files
spacedrive/interface/app/$libraryId/Explorer/FilePath/EraseDialog.tsx
jake 7abc116d0f [ENG-440] Crypto Refactor (#2115)
* rebase: `crates/crypto` into current `main`

* refactor: remove `mnemonic` module

* feat: disable secure erase temporarily

* fix: tsc

* fix: tsc due to unused import

* fix: remove `cli` crypto info

* deps: update

* chore: remove dead comment

* refactor: remove `bincode` feature

* refactor: give `keyring` a dedicated feature so it's not reliant on `sys` as well

* fix: remove `aes-gcm` as it's no longer supported

* refactor: remove dead comment

* fix: update `keyring` imports

* refactor: change tests to `aes-256-gcm`

* feat: make `Key` a `Box<>` internally to ensure it's heap allocated (and fix tests)

* chore: clippy

* fix: hashing tests now that `const` keys aren't available

this will be cleaned up with test vectors and `include_bytes!()`

* chore: clippy

* refactor: remove dead code

* test: bring back `encrypt_with_invalid_nonce` test

* fix: secret service keyring

* fix: `zbus` build issues

* doc: update comment for clearer reasoning

* fix: cargo fmt

* fix: use bytes directly

* deps: update lockfile

* fix: secret service keyring

* fix: comment out windows keyring for now

* fix: use session keyring if no keyring backend

* fix: completely remove keyring module if no keyring is available for that OS

* fix: clippy

* fix: move iimport to correct conditional compilation

* fix: fmt
2024-03-07 08:00:37 +00:00

69 lines
1.8 KiB
TypeScript

// import { useState } from 'react';
// import { FilePath, useLibraryMutation, useZodForm } from '@sd/client';
// import { Dialog, Slider, useDialog, UseDialogProps, z } from '@sd/ui';
// import { useLocale } from '~/hooks';
// interface Props extends UseDialogProps {
// locationId: number;
// filePaths: FilePath[];
// }
// const schema = z.object({
// passes: z.number()
// });
// export default (props: Props) => {
// const { t } = useLocale();
// const eraseFile = useLibraryMutation('files.eraseFiles');
// const form = useZodForm({
// schema,
// defaultValues: {
// passes: 4
// }
// });
// const [passes, setPasses] = useState([4]);
// return (
// <Dialog
// form={form}
// onSubmit={form.handleSubmit((data) =>
// eraseFile.mutateAsync({
// location_id: props.locationId,
// file_path_ids: props.filePaths.map((p) => p.id),
// passes: data.passes.toString()
// })
// )}
// dialog={useDialog(props)}
// title={t('erase_a_file')}
// description={t('erase_a_file_description')}
// loading={eraseFile.isLoading}
// ctaLabel={t('erase')}
// >
// <div className="mt-2 flex flex-col">
// <span className="text-xs font-bold">{t('number_of_passes')}</span>
// <div className="flex flex-row space-x-2">
// <div className="relative mt-2 flex grow">
// <Slider
// value={passes}
// max={16}
// min={1}
// step={1}
// defaultValue={[4]}
// onValueChange={(val) => {
// setPasses(val);
// form.setValue('passes', val[0] ?? 1);
// }}
// />
// </div>
// <span className="mt-2.5 text-sm font-medium">{passes}</span>
// </div>
// </div>
// {/* <p>TODO: checkbox for "erase all matching files" (only if a file is selected)</p> */}
// </Dialog>
// );
// };