"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const ui = require("@contember/ui");
const react = require("react");
const reactRouting = require("@contember/react-routing");
const useForm = require("../../lib/useForm.cjs");
const initialValues = {
  token: ""
};
const FillResetPasswordTokenForm = ({ resetLink }) => {
  const redirect = reactRouting.useRedirect();
  const { register, isSubmitting, onSubmit } = useForm.useForm(
    initialValues,
    react.useCallback(
      async (values) => {
        redirect(resetLink, { token: values.token });
      },
      [redirect, resetLink]
    )
  );
  return /* @__PURE__ */ jsxRuntime.jsx("form", { onSubmit, children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Stack, { gap: "large", children: [
    /* @__PURE__ */ jsxRuntime.jsx(ui.FieldContainer, { label: "Token", children: /* @__PURE__ */ jsxRuntime.jsx(ui.TextInput, { ...register("token"), required: true }) }),
    /* @__PURE__ */ jsxRuntime.jsx(ui.FieldContainer, { label: void 0, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { distinction: "primary", type: "submit", disabled: isSubmitting, children: "Continue" }) })
  ] }) });
};
exports.FillResetPasswordTokenForm = FillResetPasswordTokenForm;
//# sourceMappingURL=FillResetPasswordTokenForm.cjs.map
