import H from "../../../@babel/runtime/helpers/esm/extends.mjs";
import * as a from "react";
import R from "../Cell/index.mjs";
import g from "../context/TableContext.mjs";
import { useContext as k } from "../../../@rc-component/context/es/context.mjs";
import "../../../rc-util/node_modules/react-is/index.mjs";
import { getCellFixedInfo as E } from "../utils/fixUtil.mjs";
import { getColumnsKey as P } from "../utils/valueUtil.mjs";
function I(e) {
  var t = e.cells, p = e.stickyOffsets, s = e.flattenColumns, d = e.rowComponent, c = e.cellComponent, C = e.tdCellComponent, r = e.onHeaderRow, u = e.index, l = k(g, ["prefixCls", "direction"]), f = l.prefixCls, x = l.direction, i;
  r && (i = r(t.map(function(o) {
    return o.column;
  }), u));
  var w = P(t.map(function(o) {
    return o.column;
  }));
  return /* @__PURE__ */ a.createElement(d, i, t.map(function(o, v) {
    var n = o.column, y = E(o.colStart, o.colEnd, s, p, x, n), m;
    return n && n.onHeaderCell && (m = o.column.onHeaderCell(n)), /* @__PURE__ */ a.createElement(R, H({}, o, {
      scope: n.title ? o.colSpan > 1 ? "colgroup" : "col" : null,
      ellipsis: n.ellipsis,
      align: n.align,
      component: n.title ? c : C,
      prefixCls: f,
      key: w[v]
    }, y, {
      additionalProps: m,
      rowType: "header"
    }));
  }));
}
I.displayName = "HeaderRow";
export {
  I as default
};
