import { jsxs as w, Fragment as g, jsx as t } from "react/jsx-runtime";
import { AnimatePresence as v } from "motion/react";
import { isValidElement as B, cloneElement as C } from "react";
import x from "./TableEmptyRow.js";
const j = (m) => {
  const {
    columnCount: c,
    hasDeclaredChildren: u,
    htmlAttributes: p,
    isVirtualized: d,
    itemsRef: y,
    paddingBottom: i,
    paddingTop: l,
    renderConfigContext: h,
    renderContext: o,
    shouldAnimateBodyRows: f,
    virtualRows: R
  } = m, a = (e) => {
    const n = `${e.kind}-${String(e.rowId)}`, s = o.renderBodyRow?.(e);
    return B(s) ? C(s, { key: n }) : null;
  }, b = (e) => {
    y.current = e;
  }, r = (e) => /* @__PURE__ */ t(
    "div",
    {
      ...p,
      className: "table-body",
      ref: d ? b : void 0,
      role: "rowgroup",
      children: e
    }
  );
  if (d)
    return r(
      /* @__PURE__ */ w(g, { children: [
        l > 0 ? /* @__PURE__ */ t("div", { "aria-hidden": !0, className: "table-body-virtual-spacer", style: { height: l } }) : null,
        R.map(({ row: e }) => a(e)),
        i > 0 ? /* @__PURE__ */ t("div", { "aria-hidden": !0, className: "table-body-virtual-spacer", style: { height: i } }) : null
      ] })
    );
  if (o.bodyRows.length > 0) {
    const e = o.bodyRows.map((n) => a(n));
    return r(
      f ? /* @__PURE__ */ t(v, { initial: !1, children: e }) : e
    );
  }
  return r(u ? null : /* @__PURE__ */ t(x, { columnCount: c, content: h.noRowsState }));
};
export {
  j as default
};
//# sourceMappingURL=TableBodyContent.js.map
