mirror of
https://github.com/Alvin-Zilverstand/nginx-proxy-manager.git
synced 2026-11-25 15:43:14 +01:00
React
This commit is contained in:
355 files changed
+9308
-17813
No files matched your search
@@ -0,0 +1,39 @@
|
||||
import { flexRender } from "@tanstack/react-table";
|
||||
import type { TableLayoutProps } from "src/components";
|
||||
import { EmptyRow } from "./EmptyRow";
|
||||
|
||||
function TableBody<T>(props: TableLayoutProps<T>) {
|
||||
const { tableInstance, extraStyles, emptyState } = props;
|
||||
const rows = tableInstance.getRowModel().rows;
|
||||
|
||||
if (rows.length === 0) {
|
||||
return emptyState ? (
|
||||
emptyState
|
||||
) : (
|
||||
<tbody className="table-tbody">
|
||||
<EmptyRow tableInstance={tableInstance} />
|
||||
</tbody>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<tbody className="table-tbody">
|
||||
{rows.map((row: any) => {
|
||||
return (
|
||||
<tr key={row.id} {...extraStyles?.row(row.original)}>
|
||||
{row.getVisibleCells().map((cell: any) => {
|
||||
const { className } = (cell.column.columnDef.meta as any) ?? {};
|
||||
return (
|
||||
<td key={cell.id} className={className}>
|
||||
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
||||
</td>
|
||||
);
|
||||
})}
|
||||
</tr>
|
||||
);
|
||||
})}
|
||||
</tbody>
|
||||
);
|
||||
}
|
||||
|
||||
export { TableBody };
|
||||
Reference in new issue
Block a user