import Link from "next/link"; import { prisma } from "@/lib/prisma"; import { formatMoney, billingLabel } from "@/lib/format"; export default async function AdminCoursesPage() { const courses = await prisma.course.findMany({ orderBy: { updatedAt: "desc" }, include: { _count: { select: { enrollments: true, modules: true } } }, }); return (

Kurse

Alle Kurse inkl. Entwürfe

Neuer Kurs
{courses.map((c) => ( ))}
Titel Slug Status Preis Module Einschreibungen
{c.title} {c.slug} {c.published ? "Live" : "Entwurf"} {c.priceCents === 0 ? ( "kostenlos" ) : ( <> {formatMoney(c.priceCents, c.currency)} {billingLabel(c.billingInterval) ? ` ${billingLabel(c.billingInterval)}` : ""} )} {c._count.modules} {c._count.enrollments} Bearbeiten
); }