import { jsxs as r, jsx as a } from "react/jsx-runtime";
import l from "../../../../utils/classNames.js";
import p from "../../SortArrows.js";
const u = (c) => {
  const { column: e, dragActivatorProps: t, dragActivatorRef: n, hideWhileDragging: d, onSortChange: b } = c, s = e.hideLabel && typeof e.label == "string" ? e.label : void 0, i = e.hideLabel ? null : e.icon ? /* @__PURE__ */ r("span", { className: "display-flex align-items-center gap-5", children: [
    /* @__PURE__ */ a("span", { className: l("text-color-dark rioglyph", e.icon) }),
    /* @__PURE__ */ a("span", { children: e.label })
  ] }) : e.label, o = i === null ? null : /* @__PURE__ */ a("span", { className: "table-head-label", children: i });
  return /* @__PURE__ */ a("div", { className: l("table-head-cell-content", d && "table-head-cell-content-hidden"), children: /* @__PURE__ */ r("div", { className: "table-head-cell-content-row", children: [
    e.sortable ? /* @__PURE__ */ a(
      "button",
      {
        type: "button",
        className: l("table-head-button", e.filter && "table-head-button-has-filter"),
        "aria-label": s,
        onClick: (h) => b?.(
          e.columnKey ?? String(e.key),
          e.sortDirection === "asc" ? "desc" : "asc",
          h
        ),
        children: /* @__PURE__ */ r(
          "span",
          {
            ref: n,
            className: l(
              "table-head-button-label",
              t && "table-head-drag-label"
            ),
            ...t,
            children: [
              /* @__PURE__ */ a(p, { direction: e.sortDirection }),
              o
            ]
          }
        )
      }
    ) : /* @__PURE__ */ a(
      "span",
      {
        ref: n,
        className: l(
          "table-head-label-wrapper",
          e.filter && "table-head-label-wrapper-has-filter",
          t && "table-head-drag-label"
        ),
        "aria-label": s,
        ...t,
        children: o
      }
    ),
    e.filter && /* @__PURE__ */ a("span", { className: "table-head-filter", children: e.filter })
  ] }) });
};
export {
  u as default
};
//# sourceMappingURL=TableHeaderCellContent.js.map
