import type { JSX } from "react" import { notFound } from "next/navigation" import { getTranslations } from "next-intl/server" import Link from "next/link" import { Button } from "@/shared/components/ui/button" import { EmptyState } from "@/shared/components/ui/empty-state" import { BarChart3, ArrowLeft } from "lucide-react" import { getExamById } from "@/modules/exams/data-access" import { getExamAnalytics } from "@/modules/exams/stats-service" import { ExamAnalyticsDashboard } from "@/modules/exams/components/exam-analytics-dashboard" export const dynamic = "force-dynamic" export default async function ExamAnalyticsPage({ params }: { params: Promise<{ id: string }> }): Promise { const { id } = await params const t = await getTranslations("examHomework") const [exam, analytics] = await Promise.all([ getExamById(id), getExamAnalytics(id), ]) if (!exam) return notFound() return (

{t("exam.analytics.title")}

{exam.title}

{t("exam.analytics.description")}

{analytics && analytics.gradedCount > 0 ? ( ) : ( )}
) }