refactor hooks organization and month picker

This commit is contained in:
Felipe Coutinho
2026-03-06 16:39:49 +00:00
parent 9a5e9161db
commit ad0df4ea81
22 changed files with 239 additions and 239 deletions

View File

@@ -85,17 +85,17 @@ export function NoteDialog({
const initialState = buildInitialValues(note);
const { formState, updateField, setFormState } =
const { formState, resetForm, updateField } =
useFormState<NoteFormValues>(initialState);
useEffect(() => {
if (dialogOpen) {
setFormState(buildInitialValues(note));
resetForm(buildInitialValues(note));
setErrorMessage(null);
setNewTaskText("");
requestAnimationFrame(() => titleRef.current?.focus());
}
}, [dialogOpen, note, setFormState]);
}, [dialogOpen, note, resetForm]);
const dialogTitle = mode === "create" ? "Nova anotação" : "Editar anotação";
const description =