import { flexRender } from "@tanstack/react-table"; import type { TableLayoutProps } from "src/components"; import { EmptyRow } from "./EmptyRow"; function TableBody(props: TableLayoutProps) { const { tableInstance, extraStyles, emptyState } = props; const rows = tableInstance.getRowModel().rows; if (rows.length === 0) { return ( {emptyState ? emptyState : } ); } return ( {rows.map((row: any) => { return ( {row.getVisibleCells().map((cell: any) => { const { className } = (cell.column.columnDef.meta as any) ?? {}; return ( {flexRender(cell.column.columnDef.cell, cell.getContext())} ); })} ); })} ); } export { TableBody };