import { getServerSession } from "../../api/auth/[...nextauth]/auth"; import { PrismaClient } from "@repo/db"; import { KursItem } from "./_components/item"; import { RocketIcon } from "@radix-ui/react-icons"; export default async () => { const prisma = new PrismaClient(); const session = await getServerSession(); if (!session) return null; const user = await prisma.user.findUnique({ where: { id: session.user.id, }, }); if (!user) return null; const events = await prisma.event.findMany({ include: { appointments: { where: { appointmentDate: { gte: new Date(), }, }, }, participants: { where: { userId: user.id, }, }, }, }); const userAppointments = await prisma.eventAppointment.findMany({ where: { Participants: { some: { userId: user.id, }, }, }, }); return (