import { jsxDEV } from "react/jsx-dev-runtime";
import { Stack, FieldContainer, TextInput, Button } from "@contember/ui";
import { useCallback } from "react";
import { useRedirect } from "@contember/react-routing";
import { useForm } from "../../lib/useForm.js";
const initialValues = {
  token: ""
};
const FillResetPasswordTokenForm = ({ resetLink }) => {
  const redirect = useRedirect();
  const { register, isSubmitting, onSubmit } = useForm(
    initialValues,
    useCallback(
      async (values) => {
        redirect(resetLink, { token: values.token });
      },
      [redirect, resetLink]
    )
  );
  return /* @__PURE__ */ jsxDEV("form", { onSubmit, children: /* @__PURE__ */ jsxDEV(Stack, { gap: "large", children: [
    /* @__PURE__ */ jsxDEV(FieldContainer, { label: "Token", children: /* @__PURE__ */ jsxDEV(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__ */ jsxDEV(FieldContainer, { label: void 0, children: /* @__PURE__ */ jsxDEV(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);
};
export {
  FillResetPasswordTokenForm
};
//# sourceMappingURL=FillResetPasswordTokenForm.js.map
