import { jsxs as e, jsx as o } from "react/jsx-runtime";
import f from "react";
import { noop as v } from "es-toolkit/function";
import B from "../button/Button.js";
import d from "../../utils/classNames.js";
import { useDialogContext as x } from "./dialogContext.js";
const T = (i) => {
  const { title: s, subtitle: t, headerButtons: l, onCloseButtonClick: n = v, ...c } = i, { onClose: m, isSmallestDialog: a, showXsDialogBorders: h, showCloseButton: u } = x(), r = a ? h : !0, g = a ? !1 : u, p = d("modal-header", !r && "border-bottom-none"), b = d(
    "modal-header-text",
    !r && "padding-bottom-0 width-100pct"
  ), C = (N) => {
    n(), m(N);
  };
  return /* @__PURE__ */ e("div", { ...c, className: p, "aria-label": "dialog header", children: [
    /* @__PURE__ */ e("div", { className: b, children: [
      t && /* @__PURE__ */ o("div", { className: "modal-header-subtitle", children: t }),
      /* @__PURE__ */ o("div", { className: "modal-header-title", children: s })
    ] }),
    /* @__PURE__ */ e("div", { className: "modal-header-buttons", children: [
      l && !a && /* @__PURE__ */ e(f.Fragment, { children: [
        l,
        /* @__PURE__ */ o("div", { className: "modal-header-buttons-spacer" })
      ] }),
      g && /* @__PURE__ */ o(
        B,
        {
          bsStyle: "muted",
          iconOnly: !0,
          iconName: "rioglyph-remove",
          autoTrackingKey: `dialog::closed::${s}`,
          className: "modal-header-close close",
          onClick: C,
          "data-testid": "close",
          "aria-label": "dialog close button"
        }
      )
    ] })
  ] });
};
export {
  T as default
};
//# sourceMappingURL=DialogHeader.js.map
