import { jsx as d } from "@emotion/react/jsx-runtime";
import { useFormContext as p, useFormState as f } from "react-hook-form";
import { useModuleDictionary as S } from "@m4l/core";
import { useComponentSize as b } from "../../../../hooks/useComponentSize/index.js";
import { classActoinFormIntroRoot as z } from "./constanst.js";
import { clsx as I } from "clsx";
import { DICTIONARY as A } from "../../dictionary.js";
import { LoadingButtonActionFormIntroRootStyled as F } from "./slots/ActionFormIntroSlots.js";
function D(t) {
  const { variant: r = "contained", color: m = "primary", className: e, label: i, size: n = "medium", ...s } = t, { getLabel: a } = S(), c = i || a(A.LABEL_INTRO), { control: l } = p(), { isSubmitting: u } = f({ control: l }), { currentSize: o } = b(n);
  return /* @__PURE__ */ d(
    F,
    {
      variant: r,
      type: "submit",
      color: m,
      loading: u,
      size: o === "small" || o === "medium" ? o : "medium",
      className: I(z, e),
      label: c,
      ...s
    }
  );
}
export {
  D as ActionFormIntro
};
