import type { FunctionComponent } from "react"; import { useState } from "react"; import { useRouter } 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"; const logger = appLogger.child({ module: "update-password" }); type Form = { newPassword: string; newPasswordConfirmation: string; }; const UpdatePassword: FunctionComponent = () => { const router = useRouter(); const { register, handleSubmit, formState: { isSubmitting, isSubmitSuccessful }, } = useForm