data table

This commit is contained in:
PxlLoewe
2025-02-06 00:18:44 +01:00
parent 71b401f8ab
commit be5128053f
6 changed files with 161 additions and 15 deletions

View File

@@ -0,0 +1,27 @@
import SortableTable, { SortableTableProps } from './Table';
interface PaginatedTableProps<TData>
extends Omit<SortableTableProps<TData>, 'data'> {
prismaGetter: (
fnProps: {
cursor: number;
take: number;
} & any
) => Promise<any>;
}
export async function PaginatedTable<TData>({
prismaGetter,
...restProps
}: PaginatedTableProps<TData>) {
const data = await prismaGetter({
cursor: 0,
take: 10,
});
return (
<div>
<SortableTable data={data} {...restProps} />
</div>
);
}