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