diff --git a/apps/admin-ui/src/clients/keys/GenerateKeyDialog.tsx b/apps/admin-ui/src/clients/keys/GenerateKeyDialog.tsx index 93e0bc08b1..18afad673c 100644 --- a/apps/admin-ui/src/clients/keys/GenerateKeyDialog.tsx +++ b/apps/admin-ui/src/clients/keys/GenerateKeyDialog.tsx @@ -5,7 +5,7 @@ import { FormProvider, useForm, useFormContext, -} from "react-hook-form"; +} from "react-hook-form-v7"; import { Button, ButtonVariant, @@ -46,6 +46,10 @@ const extensions = new Map([ ["BCFKS", "bcfks"], ]); +type FormFields = KeyStoreConfig & { + file: string | File; +}; + export const getFileExtension = (format: string) => extensions.get(format); export const KeyForm = ({ @@ -58,7 +62,7 @@ export const KeyForm = ({ const [filename, setFilename] = useState(); const [openArchiveFormat, setOpenArchiveFormat] = useState(false); - const { control, watch } = useFormContext(); + const { control, watch } = useFormContext(); const format = watch("format"); const { cryptoInfo } = useServerInfo(); @@ -79,15 +83,15 @@ export const KeyForm = ({ name="format" defaultValue="JKS" control={control} - render={({ onChange, value }) => ( + render={({ field }) => (