import prisma from '@/lib/prisma'; import ActiveCard from './ActiveCard'; import { getAuthServerSession } from '@/lib/authenticate'; import { redirect } from 'next/navigation'; export default async function Dashboard() { const authSession = await getAuthServerSession(); console.log(authSession); if (!authSession) return redirect('/'); const tests = await prisma.test.findMany({ select: { isActive: true, isPassed: true, id: true, testOf: { select: { id: true, firstName: true, lastName: true, isTeacher: true } } } }); const activeTests = tests.filter((test) => test.isActive); const passedTests = tests.filter((test) => test.isPassed); return (