import { createFormHook, createFormHookContexts } from '@tanstack/react-form';
import { TextField, TextFieldErrorMessage } from '../components/Form/TextField';
import { ResetButton, SubmitButton } from '../components/Form/Button';

const { fieldContext, formContext } = createFormHookContexts();

export const formHook = createFormHook({
  fieldComponents: {
    TextField,
    TextFieldErrorMessage,
  },
  formComponents: {
    SubmitButton,
    ResetButton,
  },
  fieldContext,
  formContext,
});
