ConceptPortal-public/rsconcept/frontend/src/components/DataTable/TableFooter.tsx
Ivan 17b94b5e9a
Some checks are pending
Frontend CI / build (22.x) (push) Waiting to run
R: Refactoring folder structure: introducing features
2025-02-10 01:32:55 +03:00

26 lines
678 B
TypeScript

'use no memo';
import { flexRender, Header, HeaderGroup, Table } from '@tanstack/react-table';
interface TableFooterProps<TData> {
table: Table<TData>;
}
function TableFooter<TData>({ table }: TableFooterProps<TData>) {
return (
<tfoot>
{table.getFooterGroups().map((footerGroup: HeaderGroup<TData>) => (
<tr key={footerGroup.id}>
{footerGroup.headers.map((header: Header<TData, unknown>) => (
<th key={header.id}>
{!header.isPlaceholder ? flexRender(header.column.columnDef.footer, header.getContext()) : null}
</th>
))}
</tr>
))}
</tfoot>
);
}
export default TableFooter;