import React, { useContext } from "react" import classnames from "classnames"; import { buildCss } from "../../utilities/props"; import { globalProps } from "../../utilities/globalProps"; import LoadingInline from "../../pb_loading_inline/_loading_inline" import { flexRender, Row } from "@tanstack/react-table" import { SubRowHeaderRow } from "../Components/SubRowHeaderRow" import { LoadingCell } from "../Components/LoadingCell" import { renderCollapsibleTrail } from "../Components/CollapsibleTrail" import AdvancedTableContext from "../Context/AdvancedTableContext" import { isChrome } from "../Utilities/BrowserCheck" import { DataType } from "../Utilities/types" type TableBodyProps = { className?: string; collapsibleTrail?: boolean id?: string; subRowHeaders?: string[] } export const TableBody = ({ className, collapsibleTrail = true, id, subRowHeaders, ...props }: TableBodyProps) => { const { columnDefinitions, enableToggleExpansion, handleExpandOrCollapse, inlineRowLoading, loading, table, } = useContext(AdvancedTableContext) const classes = classnames( buildCss("pb_advanced_table_body"), globalProps(props), className ); return ( <>
{table.getRowModel().rows.map((row: Row