"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxDevRuntime = require("react/jsx-dev-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__ */ jsxDevRuntime.jsxDEV("form", { onSubmit, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(ui.Stack, { gap: "large", children: [
    /* @__PURE__ */ jsxDevRuntime.jsxDEV(ui.FieldContainer, { label: "Token", children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(ui.TextInput, { ...register("token"), required: true }, void 0, false, {
      fileName: "/__w/interface/interface/packages/admin/src/tenant/components/password/FillResetPasswordTokenForm.tsx",
      lineNumber: 29,
      columnNumber: 6
    }, void 0) }, void 0, false, {
      fileName: "/__w/interface/interface/packages/admin/src/tenant/components/password/FillResetPasswordTokenForm.tsx",
      lineNumber: 28,
      columnNumber: 5
    }, void 0),
    /* @__PURE__ */ jsxDevRuntime.jsxDEV(ui.FieldContainer, { label: void 0, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(ui.Button, { distinction: "primary", type: "submit", disabled: isSubmitting, children: "Continue" }, void 0, false, {
      fileName: "/__w/interface/interface/packages/admin/src/tenant/components/password/FillResetPasswordTokenForm.tsx",
      lineNumber: 32,
      columnNumber: 6
    }, void 0) }, void 0, false, {
      fileName: "/__w/interface/interface/packages/admin/src/tenant/components/password/FillResetPasswordTokenForm.tsx",
      lineNumber: 31,
      columnNumber: 5
    }, void 0)
  ] }, void 0, true, {
    fileName: "/__w/interface/interface/packages/admin/src/tenant/components/password/FillResetPasswordTokenForm.tsx",
    lineNumber: 27,
    columnNumber: 4
  }, void 0) }, void 0, false, {
    fileName: "/__w/interface/interface/packages/admin/src/tenant/components/password/FillResetPasswordTokenForm.tsx",
    lineNumber: 26,
    columnNumber: 3
  }, void 0);
};
exports.FillResetPasswordTokenForm = FillResetPasswordTokenForm;
//# sourceMappingURL=FillResetPasswordTokenForm.cjs.map
