import { jsx as d } from "../../../../external/.pnpm/preact@10.28.2/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
import i from "classnames";
import { useDataGridContext as l } from "../hooks/useDataGridContext.js";
import { useRef as c, useEffect as o } from "../../../../external/.pnpm/preact@10.28.2/node_modules/preact/hooks/dist/hooks.module.js";
const _ = ({ cellKey: e, position: t, label: n }) => {
  const { registerCells: a } = l(), r = c(null);
  return o(() => {
    r.current && a({
      column: e,
      width: r.current?.getBoundingClientRect().width
    });
  }, [e, a]), /* @__PURE__ */ d(
    "div",
    {
      role: "columnheader",
      id: String(e),
      className: i("adyen-pe-data-grid__cell adyen-pe-data-grid__cell--heading", {
        "adyen-pe-data-grid__cell--right": t === "right",
        "adyen-pe-data-grid__cell--center": t === "center"
      }),
      children: /* @__PURE__ */ d("div", { ref: r, className: "adyen-pe-data-grid__cell--heading-content", children: n })
    }
  );
};
export {
  _ as TableHeaderCell
};
