import { headers } from "next/headers"; import { auth } from "@/lib/auth"; import { redirect } from "next/navigation"; import { prisma } from "@/lib/prisma"; import Link from "next/link"; export default async function CuratorDashboard() { const session = await auth.api.getSession({ headers: await headers() }); if (!session) redirect("/login"); const [pending, total, recentFeedbacks] = await Promise.all([ prisma.homeworkSubmission.count({ where: { feedbacks: { none: {} } } }), prisma.homeworkSubmission.count(), prisma.homeworkFeedback.count({ where: { createdAt: { gte: new Date(new Date().getTime() - 7 * 24 * 60 * 60 * 1000) }, curatorId: session.user.id, }, }), ]); return (
Панель куратора
✓
Все работы проверены
Новых заданий нет
{value}
{label}