import { j as d } from "../../../_virtual/jsx-runtime.js";
import { getId as x } from "../../../utils/index.js";
import { StyledModalContent as k, ModalFooter as p } from "../styles.js";
import { ModalHeader as M } from "./ModalHeader.js";
import { ModalActions as f } from "./ModalActions.js";
import { DialogLoading as I } from "./DialogLoading.js";
function H({
  children: j,
  onClose: n,
  pinnedFooter: g,
  action: e,
  variant: o,
  hideCloseIcon: c,
  title: r,
  primaryAction: l,
  dismissAction: s,
  stackedActionButtons: i,
  isLoading: h,
  ...m
}) {
  const a = x(m["data-testid"]), t = x(m["data-trackid"]);
  return /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
    r && r.text && /* @__PURE__ */ d.jsx(
      M,
      {
        onClose: n,
        hideCloseIcon: c,
        mode: r.mode,
        variant: o,
        "data-testid": a("dialog-header"),
        "data-trackid": t("dialog-header"),
        children: r.text
      }
    ),
    /* @__PURE__ */ d.jsxs(
      k,
      {
        pinnedFooter: g,
        stackedActionButtons: i,
        action: e,
        "data-testid": a("dialog-content"),
        "data-trackid": t("dialog-content"),
        variant: o,
        children: [
          h ? /* @__PURE__ */ d.jsx(
            I,
            {
              "data-testid": a("dialog-loading"),
              "data-trackid": t("dialog-loading")
            }
          ) : /* @__PURE__ */ d.jsx(d.Fragment, { children: j }),
          e && /* @__PURE__ */ d.jsxs(
            p,
            {
              pinnedFooter: g,
              stackedActionButtons: i,
              "data-testid": a("dialog-footer"),
              "data-trackid": t("dialog-footer"),
              variant: o,
              children: [
                e === "confirm" && l && s && /* @__PURE__ */ d.jsx(
                  f,
                  {
                    primaryAction: l,
                    dismissAction: s,
                    variant: o,
                    stackedActionButtons: i,
                    "data-testid": a(),
                    "data-trackid": t()
                  }
                ),
                e === "acknowledge" && l && /* @__PURE__ */ d.jsx(
                  f,
                  {
                    primaryAction: l,
                    variant: o,
                    stackedActionButtons: i,
                    "data-testid": a(),
                    "data-trackid": t()
                  }
                )
              ]
            }
          )
        ]
      }
    )
  ] });
}
export {
  H as DialogContent
};
