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(Date.now() - 7 * 24 * 60 * 60 * 1000) }, curatorId: session.user.id, }, }), ]); return (

Обзор

Панель куратора

0} />
{pending > 0 ? ( Перейти к проверке ({pending}) → ) : (

Все работы проверены

Новых заданий нет

)}
); } function StatCard({ label, value, accent }: { label: string; value: number; accent?: boolean }) { return (

{value}

{label}

); }