import type { FunctionComponent } from "react"; import { useEffect, useState } from "react"; import { useMutation } from "blitz"; import { useForm } from "react-hook-form"; import updateUser from "../mutations/update-user"; import Alert from "../../core/components/alert"; import Button from "./button"; import SettingsSection from "./settings-section"; import useCurrentUser from "../../core/hooks/use-current-user"; import appLogger from "../../../integrations/logger"; type Form = { fullName: string; email: string; }; const logger = appLogger.child({ module: "profile-settings" }); const ProfileInformations: FunctionComponent = () => { const { user } = useCurrentUser(); const updateUserMutation = useMutation(updateUser)[0]; const { register, handleSubmit, setValue, formState: { isSubmitting, isSubmitSuccessful }, } = useForm