import { getTranslations } from "next-intl/server" import { Card, CardContent, CardHeader, CardTitle } from "@/shared/components/ui/card" import { Badge } from "@/shared/components/ui/badge" import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@/shared/components/ui/table" import { EmptyState } from "@/shared/components/ui/empty-state" import { Trophy } from "lucide-react" import { GradeStatsCard } from "./grade-stats-card" import type { ClassGradeStats, ClassRankingItem } from "../types" interface ClassGradeReportProps { stats: ClassGradeStats | null ranking: ClassRankingItem[] } export async function ClassGradeReport({ stats, ranking }: ClassGradeReportProps) { const t = await getTranslations("grades") return (
{stats ? (

{stats.className}

{t("classReport.studentCountInfo", { studentCount: stats.studentCount, recordCount: stats.stats.count })}

) : ( )} {ranking.length > 0 ? ( {t("classReport.classRanking")}
{t("classReport.rankColumn")} {t("list.columns.student")} {t("summary.averageScore")} {t("classReport.recordsColumn")} {ranking.map((r) => ( #{r.rank} {r.studentName} {r.averageScore.toFixed(2)} {r.recordCount} ))}
{t("classReport.caption")}
) : null}
) }