import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
import { LayoutPageStickyContainer, Stack, ButtonList, Button, Icon, Divider } from "@contember/ui";
import { memo, useCallback } from "react";
import { DataGridColumnHiding } from "../DataGridColumnHiding.js";
import { dataGridDictionary } from "../dataGridDictionary.js";
import { DataGridFullFilters } from "../DataGridFullFilters.js";
import { useMessageFormatter } from "../../../../../../i18n/useMessageFormatter.js";
const DataGridContainerHeader = memo(({
  accessor,
  allowAggregateFilterControls,
  allowColumnVisibilityControls,
  desiredState,
  hasTile,
  pagingSummary,
  setFilter,
  setIsColumnHidden,
  setLayout
}) => {
  const { layout } = desiredState;
  const formatMessage = useMessageFormatter(dataGridDictionary);
  const setDefaultView = useCallback(() => setLayout("default"), [setLayout]);
  const setTileView = useCallback(() => setLayout("tiles"), [setLayout]);
  return /* @__PURE__ */ jsxDEV(
    LayoutPageStickyContainer,
    {
      left: "var(--cui-layout-page-padding-left)",
      right: "var(--cui-layout-page-padding-right)",
      children: /* @__PURE__ */ jsxDEV(Stack, { wrap: true, align: "center", direction: "horizontal", justify: "space-between", children: [
        /* @__PURE__ */ jsxDEV(Stack, { gap: "small", direction: "horizontal", children: [
          hasTile && /* @__PURE__ */ jsxDEV(Fragment, { children: [
            /* @__PURE__ */ jsxDEV(ButtonList, { children: [
              /* @__PURE__ */ jsxDEV(Button, { onClick: setTileView, size: "small", distinction: "seamless", intent: layout === "tiles" ? "primary" : "default", children: /* @__PURE__ */ jsxDEV(Icon, { blueprintIcon: "grid-view" }, void 0, false, {
                fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/DataGridContainerHeader.tsx",
                lineNumber: 51,
                columnNumber: 9
              }, globalThis) }, void 0, false, {
                fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/DataGridContainerHeader.tsx",
                lineNumber: 50,
                columnNumber: 8
              }, globalThis),
              /* @__PURE__ */ jsxDEV(Button, { onClick: setDefaultView, size: "small", distinction: "seamless", intent: layout === "default" ? "primary" : "default", children: /* @__PURE__ */ jsxDEV(Icon, { blueprintIcon: "list" }, void 0, false, {
                fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/DataGridContainerHeader.tsx",
                lineNumber: 54,
                columnNumber: 9
              }, globalThis) }, void 0, false, {
                fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/DataGridContainerHeader.tsx",
                lineNumber: 53,
                columnNumber: 8
              }, globalThis)
            ] }, void 0, true, {
              fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/DataGridContainerHeader.tsx",
              lineNumber: 49,
              columnNumber: 7
            }, globalThis),
            /* @__PURE__ */ jsxDEV(Divider, {}, void 0, false, {
              fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/DataGridContainerHeader.tsx",
              lineNumber: 58,
              columnNumber: 7
            }, globalThis)
          ] }, void 0, true, {
            fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/DataGridContainerHeader.tsx",
            lineNumber: 48,
            columnNumber: 18
          }, globalThis),
          layout !== "tiles" && allowColumnVisibilityControls !== false && /* @__PURE__ */ jsxDEV(
            DataGridColumnHiding,
            {
              desiredState,
              formatMessage,
              setIsColumnHidden
            },
            void 0,
            false,
            {
              fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/DataGridContainerHeader.tsx",
              lineNumber: 61,
              columnNumber: 8
            },
            globalThis
          ),
          allowAggregateFilterControls !== false && /* @__PURE__ */ jsxDEV(
            DataGridFullFilters,
            {
              desiredState,
              environment: accessor.environment,
              formatMessage,
              setFilter
            },
            void 0,
            false,
            {
              fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/DataGridContainerHeader.tsx",
              lineNumber: 69,
              columnNumber: 7
            },
            globalThis
          )
        ] }, void 0, true, {
          fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/DataGridContainerHeader.tsx",
          lineNumber: 47,
          columnNumber: 5
        }, globalThis),
        /* @__PURE__ */ jsxDEV("div", { children: pagingSummary }, void 0, false, {
          fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/DataGridContainerHeader.tsx",
          lineNumber: 77,
          columnNumber: 5
        }, globalThis)
      ] }, void 0, true, {
        fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/DataGridContainerHeader.tsx",
        lineNumber: 46,
        columnNumber: 4
      }, globalThis)
    },
    void 0,
    false,
    {
      fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/DataGridContainerHeader.tsx",
      lineNumber: 42,
      columnNumber: 3
    },
    globalThis
  );
});
DataGridContainerHeader.displayName = "DataGridContainerHeader";
export {
  DataGridContainerHeader
};
//# sourceMappingURL=DataGridContainerHeader.js.map
