import { createFormHook, createFormHookContexts } from "@tanstack/react-form";
import { InputField } from "./options/InputField";
import { SubmitButton } from "./options/submitButton";
import { SelectField } from "./options/selectorField";
import { CheckboxField } from "./options/checkbox";

export const { fieldContext, useFieldContext, formContext, useFormContext } =
    createFormHookContexts();

export const { useAppForm } = createFormHook({
    fieldComponents: { InputField, SelectField, CheckboxField },
    formComponents: { SubmitButton },
    fieldContext,
    formContext,
});
