import Link from "next/link"; import { getServerSession } from "next-auth"; import { authOptions } from "@/lib/auth-options"; import { listPublishedCourses } from "@/lib/course-queries"; import { CourseCard } from "@/components/course-card"; import { prisma } from "@/lib/prisma"; import { getLandingContent } from "@/lib/landing"; export default async function HomePage() { const session = await getServerSession(authOptions); const courses = await listPublishedCourses(); const landing = await getLandingContent(); let enrolledIds = new Set(); if (session?.user?.id) { const rows = await prisma.enrollment.findMany({ where: { userId: session.user.id }, select: { courseId: true }, }); enrolledIds = new Set(rows.map((r) => r.courseId)); } return ( <>

{landing.heroTitle}

{landing.heroLead}

{landing.primaryCta.label} {landing.secondaryCta ? ( {landing.secondaryCta.label} ) : null}

Unsere Kurse & Module

{courses.map((c) => ( ))}

{landing.benefitSectionTitle}

{landing.benefits.map((b, idx) => (

{b.title}

{b.body}

))}
); }