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 { formatDate } from "@/shared/lib/utils" import { EmptyState } from "@/shared/components/ui/empty-state" import { GraduationCap } from "lucide-react" import type { StudentGradeSummary } from "../types" const typeColors: Record = { exam: "default", quiz: "secondary", homework: "outline", other: "outline", } export function StudentGradeSummary({ summary }: { summary: StudentGradeSummary | null }) { if (!summary) { return ( ) } return (
Student

{summary.studentName}

Average Score

{summary.averageScore.toFixed(2)}

Total Records

{summary.records.length}

{summary.records.length === 0 ? ( ) : ( Grade History
Title Class Subject Score Type Semester Date {summary.records.map((r) => ( {r.title} {r.className} {r.subjectName} {r.score} / {r.fullScore} {r.type} S{r.semester} {formatDate(r.createdAt)} ))}
)}
) }