|  |  | 
 |  |  |         formState: { | 
 |  |  |             errors, | 
 |  |  |             isDirty, | 
 |  |  |         } | 
 |  |  |         }, | 
 |  |  |         setError, | 
 |  |  |         clearErrors, | 
 |  |  |     } = useForm(); | 
 |  |  |  | 
 |  |  |     const [loading, setLoading] = useState(false); | 
 |  |  | 
 |  |  |                     username: data.username | 
 |  |  |                 } | 
 |  |  |                 localStorage.setItem("user", JSON.stringify(userToPersist)); | 
 |  |  |             } else if (code === 10005 || code === 10006) { | 
 |  |  |                 setError('email', { | 
 |  |  |                     message: msg | 
 |  |  |                 }) | 
 |  |  |             } else { | 
 |  |  |                 notify(msg, { type: 'error', messageArgs: { _: msg } }); | 
 |  |  |             } | 
 |  |  | 
 |  |  |                     }} | 
 |  |  |                 /> | 
 |  |  |             )} | 
 |  |  |             {/* https://github.com/themeselection/materio-mui-nextjs-admin-template-free/blob/main/javascript-version/src/views/account-settings/account/AccountDetails.jsx */} | 
 |  |  |             <form onSubmit={handleSubmit(onSubmit)} noValidate> | 
 |  |  |                 <Stack | 
 |  |  |                     direction='column' |