completed paginated Component
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import Link from 'next/link';
|
||||
import { PrismaClient } from '@repo/db';
|
||||
import { PaginatedTable } from '../app/_components/PaginatedTable';
|
||||
import { PaginatedTable } from './_components/PaginatedTable';
|
||||
|
||||
export default async function Home() {
|
||||
const prisma = new PrismaClient();
|
||||
@@ -12,12 +12,17 @@ export default async function Home() {
|
||||
<button className="btn">Logout</button>
|
||||
</Link>
|
||||
<PaginatedTable
|
||||
prismaGetter={prisma.user.findMany}
|
||||
rowsPerPage={10}
|
||||
prismaModel={'user'}
|
||||
columns={[
|
||||
{
|
||||
header: 'ID',
|
||||
accessorKey: 'id',
|
||||
},
|
||||
{
|
||||
header: 'Email',
|
||||
accessorKey: 'email',
|
||||
},
|
||||
{
|
||||
header: 'First Name',
|
||||
accessorKey: 'firstname',
|
||||
@@ -25,6 +30,7 @@ export default async function Home() {
|
||||
{
|
||||
header: 'Last Name',
|
||||
accessorKey: 'lastname',
|
||||
footer: 'Total',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user