mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-12-06 00:16:49 +00:00
React
This commit is contained in:
22
frontend/src/components/Table/TableLayout.tsx
Normal file
22
frontend/src/components/Table/TableLayout.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import type { Table as ReactTable } from "@tanstack/react-table";
|
||||
import { TableBody } from "./TableBody";
|
||||
import { TableHeader } from "./TableHeader";
|
||||
|
||||
interface TableLayoutProps<TFields> {
|
||||
tableInstance: ReactTable<TFields>;
|
||||
emptyState?: React.ReactNode;
|
||||
extraStyles?: {
|
||||
row: (rowData: TFields) => any | undefined;
|
||||
};
|
||||
}
|
||||
function TableLayout<TFields>(props: TableLayoutProps<TFields>) {
|
||||
const hasRows = props.tableInstance.getRowModel().rows.length > 0;
|
||||
return (
|
||||
<table className="table table-vcenter table-selectable mb-0">
|
||||
{hasRows ? <TableHeader tableInstance={props.tableInstance} /> : null}
|
||||
<TableBody {...props} />
|
||||
</table>
|
||||
);
|
||||
}
|
||||
|
||||
export { TableLayout, type TableLayoutProps };
|
||||
Reference in New Issue
Block a user