synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
43 lines (42 loc) • 1.33 kB
JavaScript
import { jsx as l } from "react/jsx-runtime";
import { getSlotProps as C } from "../../utils/slots/SlotUtils.js";
import { styled as g } from "@mui/material";
import { identity as P } from "lodash-es";
import { memo as S } from "react";
import { TableCellRenderer as u } from "./TableCellRenderer.js";
const N = g("tr", {
shouldForwardProp: (o) => o !== "row" && o !== "tableRow"
})({});
function h(o) {
const { table: t, slots: m = {}, slotProps: n = {} } = o, {
rows: d = t.getRowModel().rows,
rowTransform: i = P
} = o, {
Tbody: b = "tbody",
Tr: p = N,
TableCellRenderer: c = u
} = m, { Tbody: T = {}, Tr: w = {} } = n;
return /* @__PURE__ */ l(b, { ...T, children: d.map((e, f) => {
const r = i(e), a = C(w, { row: e, tableRow: r });
let s = a.className ?? "";
return t.options.meta?.getRowClassNames && (s = `${s} ${t.options.meta.getRowClassNames(
e
)}`.trim()), /* @__PURE__ */ l(
p,
{
...a,
row: e,
tableRow: r,
className: s,
children: r?.getVisibleCells().map((R, y) => /* @__PURE__ */ l(c, { ...R }, y))
},
r?.id ?? f
);
}) });
}
const F = S(h, (o, t) => o.table.options.data === t.table.options.data);
export {
F as MemoizedTableBody,
h as TableBody
};
//# sourceMappingURL=TableBody.js.map