import { jsx as t, Fragment as f } from "@emotion/react/jsx-runtime";
import { useMemo as s } from "react";
import { useModuleDictionary as d } from "@m4l/core";
import { MenuActions as I } from "../../../../../MenuActions/MenuActions.js";
import { DICTIONARY as i } from "../../../../dictionary.js";
import { LayoutDensityCompactOutlined as m, LayoutDensityStandardOutlined as l, LayoutDensityConfortableOutlined as p } from "@m4l/icons";
import { Icon as o } from "@m4l/base";
import { useDataGrid as y } from "../../../../hooks/shared/useDataGrid/useDataGrid.js";
function N() {
  const { rowHeights: a, currentRowHeightVariant: r, setRowHeightVariant: n } = y(), { getLabel: e } = d(), c = s(() => typeof a == "number" ? [] : [
    {
      type: "menuItem",
      startIcon: /* @__PURE__ */ t(o, { src: /* @__PURE__ */ t(m, {}) }),
      onClick: () => n("compact"),
      disabled: r === "compact",
      label: e(i.DENSITY_COMPACT)
    },
    {
      type: "menuItem",
      startIcon: /* @__PURE__ */ t(o, { src: /* @__PURE__ */ t(l, {}) }),
      onClick: () => n("standard"),
      disabled: r === "standard",
      label: e(i.DENSITY_STANDARD)
    },
    {
      type: "menuItem",
      startIcon: /* @__PURE__ */ t(o, { src: /* @__PURE__ */ t(p, {}) }),
      onClick: () => n("confortable"),
      disabled: r === "confortable",
      label: e(i.DENSITY_CONFORTABLE)
    }
  ], [
    a,
    r,
    n,
    e
  ]), u = s(() => r === "compact" ? /* @__PURE__ */ t(o, { src: /* @__PURE__ */ t(m, {}) }) : r === "standard" ? /* @__PURE__ */ t(o, { src: /* @__PURE__ */ t(l, {}) }) : /* @__PURE__ */ t(o, { src: /* @__PURE__ */ t(p, {}) }), [r]);
  return c.length === 0 ? /* @__PURE__ */ t(f, {}) : /* @__PURE__ */ t(
    I,
    {
      arrowType: "right-top",
      anchorOrigin: { vertical: "bottom", horizontal: "left" },
      transformOrigin: { vertical: "top", horizontal: "left" },
      menuActions: c,
      icon: u,
      toolTip: e(i.DENSITY_TOOLTIP),
      paperProps: { style: { marginTop: "5px" } }
    }
  );
}
export {
  N as Density
};
