import { jsx, jsxs } from "react/jsx-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__ */ jsx("form", { onSubmit, children: /* @__PURE__ */ jsxs(Stack, { gap: "large", children: [
    /* @__PURE__ */ jsx(FieldContainer, { label: "Token", children: /* @__PURE__ */ jsx(TextInput, { ...register("token"), required: true }) }),
    /* @__PURE__ */ jsx(FieldContainer, { label: void 0, children: /* @__PURE__ */ jsx(Button, { distinction: "primary", type: "submit", disabled: isSubmitting, children: "Continue" }) })
  ] }) });
};
export {
  FillResetPasswordTokenForm
};
//# sourceMappingURL=FillResetPasswordTokenForm.js.map
