import { jsxs as j, jsx as t } from "react/jsx-runtime";
import { memo as y } from "react";
import { TableHead as A } from "../../../table/components/TablePrimitive.js";
import S from "./hooks/useDataTableHeadCell.js";
import w from "../table-head-content/TableHeadContent.js";
import E from "../table-head-resizer/TableHeadResizer.js";
import { c as N } from "../../../../index-BtlgVD4m.js";
const B = (n) => {
  const { state: s, style: l, handlers: i, dndProps: c } = S(n), {
    column: d,
    columnAlign: e,
    headerDef: m,
    headerContext: b,
    isSelectionColumn: r,
    isActionColumn: p,
    isSorting: h,
    isBorderVisible: u,
    canResize: g,
    clickable: f,
    sorting: C,
    columnActionEnabled: x,
    draggableEnabled: o,
    colSpan: v,
    isResizing: k
  } = s, { setNodeRef: H, handleHeaderClick: T, handleResize: a, handleResizeClick: R } = i, { draggableAttributes: z, draggableListeners: D } = c;
  return /* @__PURE__ */ j(
    A,
    {
      scope: "col",
      colSpan: v,
      style: l,
      className: N(
        "flex items-center px-[var(--spacing-4)] justify-between relative gap-[var(--spacing-2)]",
        "h-[var(--height-h-12)]",
        e && `justify-${e}`,
        u && "border-r border-[var(--base-border)]",
        r && "border-r-0 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
        f && "cursor-pointer hover:bg-[var(--base-muted)] transition-colors",
        o && "cursor-move"
      ),
      onClick: T,
      ref: H,
      ...o ? { ...z, ...D } : {},
      children: [
        /* @__PURE__ */ t(
          w,
          {
            headerDef: m,
            headerContext: b,
            isSelectionColumn: r,
            isActionColumn: p,
            isSorting: h,
            sorting: C,
            columnAlign: e,
            column: d,
            columnActionEnabled: x
          }
        ),
        g && /* @__PURE__ */ t(E, { onMouseDown: a, onTouchStart: a, onClick: R, isResizing: k })
      ]
    }
  );
}, F = y(B);
export {
  F as default
};
//# sourceMappingURL=DataTableHeadCell.js.map
