import { jsx as t, jsxs as m, Fragment as A } from "@emotion/react/jsx-runtime";
import { useIsMobile as b } from "@m4l/graphics";
import { ActionsRootStyled as y, ActionsConfigContainerStyled as z, ContainerLeftActionsStyled as E, ContainerRightActionsStyled as M } from "../../slots/DataGridSlot.js";
import { useComponentSize as R } from "../../../../hooks/useComponentSize/index.js";
import { MobileMenuActions as v } from "./subcomponents/MobileMenuActions/MobileMenuActions.js";
import { Export as p } from "./subcomponents/Export/Export.js";
import { Density as F } from "./subcomponents/Density/Density.js";
import { Filter as V } from "./subcomponents/Filter/Filter.js";
import { ViewMode as j } from "./subcomponents/ViewMode/ViewMode.js";
import { Settings as B } from "../../views/CardsView/subcomponents/Settings/Settings.js";
import { Settings as D } from "../../views/ListView/subcomponents/Settings/Settings.js";
import { Settings as H } from "../../views/TableView/subcomponents/Settings/Settings.js";
import { useDataGrid as I } from "../../hooks/shared/useDataGrid/useDataGrid.js";
function Z(d) {
  const {
    withSettings: u = !0,
    settingsProps: r,
    withLocalFilters: g,
    leftActions: c,
    rightActions: i,
    withPager: S,
    size: h,
    columns: e,
    exportConfig: n
  } = d, w = b(), { rowHeights: C, viewMode: o, cardsViewConfig: l, listViewConfig: a } = I(), { currentSize: s } = R(h), f = !!e?.some((x) => x.exportable === !0) && !!n;
  return /* @__PURE__ */ t(y, { ownerState: { size: s }, children: w ? /* @__PURE__ */ m(A, { children: [
    c,
    /* @__PURE__ */ t(v, { columns: e }),
    f && /* @__PURE__ */ t(p, { exportConfig: n }),
    i
  ] }) : /* @__PURE__ */ m(z, { ownerState: { withPager: S }, children: [
    /* @__PURE__ */ m(E, { ownerState: { size: s }, children: [
      c,
      typeof C != "number" && o !== "cards" && o !== "list" && /* @__PURE__ */ t(F, {}),
      g && /* @__PURE__ */ t(V, {}),
      !u || o === "cards" && l?.customRender || o === "list" && a?.customRender ? null : o === "cards" ? /* @__PURE__ */ t(B, { ...r, columns: e }) : o === "list" ? /* @__PURE__ */ t(D, { ...r, columns: e }) : /* @__PURE__ */ t(H, { ...r, columns: e }),
      (l !== void 0 || a !== void 0) && /* @__PURE__ */ t(j, {}),
      f && /* @__PURE__ */ t(p, { exportConfig: n })
    ] }),
    i && /* @__PURE__ */ t(M, { ownerState: { size: s }, children: i })
  ] }) });
}
export {
  Z as HeaderActions
};
