import { createContext, useContext } from "react";
import { jsx } from "react/jsx-runtime";
const FormContext = createContext(null),
  useFormContext = () => {
    const context = useContext(FormContext);
    if (!context) throw new Error("useFormContext must be used within a FormProvider");
    return context;
  };
function FormProvider({
  children,
  formMethods,
  submitHandler = () => {},
  submitting = !1,
  disabled
}) {
  return /* @__PURE__ */jsx(FormContext.Provider, {
    value: {
      ...formMethods,
      submitHandler,
      submitting,
      disabled
    },
    children
  });
}
export { FormProvider, useFormContext };
//# sourceMappingURL=context.mjs.map
