import Link from 'next/link';
import { PrismaClient } from '@repo/db';
import { PaginatedTable } from './_components/PaginatedTable';

export default async function Home() {
  const prisma = new PrismaClient();

  return (
    <div>
      <h1 className="text-5xl">Hub</h1>
      <Link href="/logout">
        <button className="btn">Logout</button>
      </Link>
      <PaginatedTable
        rowsPerPage={10}
        prismaModel={'user'}
        columns={[
          {
            header: 'ID',
            accessorKey: 'id',
          },
          {
            header: 'Email',
            accessorKey: 'email',
          },
          {
            header: 'First Name',
            accessorKey: 'firstname',
          },
          {
            header: 'Last Name',
            accessorKey: 'lastname',
            footer: 'Total',
          },
        ]}
      />
    </div>
  );
}
