import { jsx as l } from "react/jsx-runtime";
import { classNames as n } from "./index-classNames.js";
import { TableProvider as x } from "./index-Table.js";
import { useContext as g } from "react";
import { Text as T, FontWeights as m, TextTypes as v } from "./index-Text.js";
import s from "./index-TableHeader.module.scss.js";
const N = (a) => {
  const {
    children: S,
    order: k = void 0,
    className: o = void 0,
    provider: c = x,
    hasGreyTheme: d
  } = a, h = g(c), {
    data: r
  } = h, t = (r == null ? void 0 : r.columns) ?? [];
  return r == null || r.options, t == null || t.length, l("thead", {
    className: n("vanguard-table-head", "table-head", o, s.tableHead),
    children: l("tr", {
      children: t != null && t.length ? t.map((e, y) => {
        const b = e.center && e.center === !0 ? s.tableCentered : "", p = e.end && e.end === !0 ? s.tableEnd : "", i = e.sticky && e.sticky === !0 ? s.tableSticky : "", f = e.seamShadow ? s.tableSeamShadow : "", C = d ? s.greyTheme : "", u = [""];
        return l("th", {
          className: n("vanguard-table-cell", "table-cell", s.tableCell, i, f, C, u.join(", ")),
          style: e != null && e.styles ? {
            ...e.styles
          } : void 0,
          children: l("div", {
            className: n(b, p),
            children: typeof e.text != "string" ? e.text() : l(T, {
              type: v.text,
              fontWeight: m.bold,
              children: e.text
            })
          })
        }, y);
      }) : null
    })
  });
};
N.styles = s;
export {
  N as TableHeader
};
