import { jsx as t, Fragment as p, jsxs as s } from "react/jsx-runtime";
import { memo as x } from "react";
import { flexRender as c } from "@tanstack/react-table";
import h from "../../hooks/useDataTableStaticContext.js";
import T from "../../hooks/useDataTableStyles.js";
import y from "../../../box/Box.js";
import b from "../../../text/Text.js";
import j from "../data-table-sort-button/DataTableSortButton.js";
import w from "../data-table-head-action/DataTableHeadAction.js";
import { c as D } from "../../../../index-BtlgVD4m.js";
const H = ({
  headerDef: r,
  headerContext: a,
  isSelectionColumn: l,
  isActionColumn: f,
  isSorting: d,
  sorting: e,
  columnAlign: m,
  column: o,
  columnActionEnabled: i
}) => {
  const { styles: n } = h(), u = T({ color: "muted" }, "headerText", n);
  return l || f ? /* @__PURE__ */ t(p, { children: c(r, a) }) : /* @__PURE__ */ s(p, { children: [
    /* @__PURE__ */ s(
      y,
      {
        className: D(
          "flex items-center w-full gap-[var(--spacing-1)]",
          i && "w-[calc(100%-28px)]",
          m && `justify-${m}`,
          "[&_span]:leading-[var(--typography-base-sizes-small-line-height)]"
        ),
        children: [
          /* @__PURE__ */ t(b, { as: "span", type: "muted", weight: "medium", truncate: !0, ...u, children: c(r, a) }),
          d && (e == null ? void 0 : e.direction) && /* @__PURE__ */ t(j, { sortDirection: e == null ? void 0 : e.direction })
        ]
      }
    ),
    i && o && /* @__PURE__ */ t(w, { column: o })
  ] });
}, _ = x(H);
export {
  _ as default
};
//# sourceMappingURL=TableHeadContent.js.map
