import type { FunctionComponent } from "react"; import { useState } from "react"; import { useMutation } from "blitz"; import { useForm } from "react-hook-form"; import Alert from "./alert"; import Button from "./button"; import SettingsSection from "./settings-section"; import appLogger from "../../../integrations/logger"; import changePassword from "../mutations/change-password"; const logger = appLogger.child({ module: "update-password" }); type Form = { currentPassword: string; newPassword: string; }; const UpdatePassword: FunctionComponent = () => { const changePasswordMutation = useMutation(changePassword)[0]; const { register, handleSubmit, formState: { isSubmitting, isSubmitSuccessful }, } = useForm