fix: patch P0 security vulnerabilities and critical UX issues across 6 modules
Security: Add admin/layout.tsx auth guard; Add requirePermission() to 12 admin pages Dashboard: Fix StudentStatsGrid rendering; Fix teacher greeting; Add loading/error boundaries; Fix col-span; Add metadata Announcements: Fix audience filtering; Add user detail page; Trigger notifications on publish; Pass classes data; Add loading.tsx Messages: Implement soft delete; Add unread badge with polling; Add notification dropdown polling; Add keyword search; Add quiet hours DND Management: Add loading/error for 9 admin routes; Fix admin-classes-view to use Select for school/grade Profile/Settings: Add loading/error; Fix parent role routing; Create ParentSettingsView; Integrate AiProviderSettingsCard; Add Tab URL persistence; Add logout confirm; Add avatar; Fix Progress arbitrary class Schema: Add senderDeletedAt/receiverDeletedAt to messages; Add quietHours to notificationPreferences; Add uniqueIndex import Docs: Update architecture docs 004/005
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
import { PenTool, TriangleAlert, Trophy, TrendingUp } from "lucide-react"
|
||||
import { BookOpen, CheckCircle, PenTool, TriangleAlert, Trophy, TrendingUp } from "lucide-react"
|
||||
|
||||
import { StatCard } from "@/shared/components/ui/stat-card"
|
||||
import type { StudentRanking } from "@/modules/homework/types"
|
||||
|
||||
export function StudentStatsGrid({
|
||||
enrolledClassCount,
|
||||
dueSoonCount,
|
||||
overdueCount,
|
||||
gradedCount,
|
||||
ranking,
|
||||
}: {
|
||||
enrolledClassCount: number
|
||||
@@ -16,12 +18,21 @@ export function StudentStatsGrid({
|
||||
}) {
|
||||
return (
|
||||
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4">
|
||||
<StatCard
|
||||
title="Enrolled Classes"
|
||||
value={String(enrolledClassCount)}
|
||||
description="Active enrollments"
|
||||
icon={BookOpen}
|
||||
href="/student/learning/courses"
|
||||
color="text-emerald-500"
|
||||
valueClassName="text-emerald-500 tabular-nums"
|
||||
/>
|
||||
<StatCard
|
||||
title="Average Score"
|
||||
value={ranking ? `${Math.round(ranking.percentage)}%` : "-"}
|
||||
description={ranking ? "Overall performance" : "No grades yet"}
|
||||
icon={TrendingUp}
|
||||
href="/student/learning/assignments"
|
||||
href="/student/grades"
|
||||
color="text-blue-500"
|
||||
valueClassName={ranking ? "text-blue-500 tabular-nums" : "tabular-nums"}
|
||||
/>
|
||||
@@ -30,10 +41,19 @@ export function StudentStatsGrid({
|
||||
value={ranking ? `${ranking.rank}/${ranking.classSize}` : "-"}
|
||||
description={ranking ? "Current position" : "No ranking yet"}
|
||||
icon={Trophy}
|
||||
href="/student/learning/assignments"
|
||||
href="/student/grades"
|
||||
color="text-purple-500"
|
||||
valueClassName={ranking ? "text-purple-500 tabular-nums" : "tabular-nums"}
|
||||
/>
|
||||
<StatCard
|
||||
title="Graded"
|
||||
value={String(gradedCount)}
|
||||
description="Completed assignments"
|
||||
icon={CheckCircle}
|
||||
href="/student/learning/assignments"
|
||||
color="text-green-500"
|
||||
valueClassName="text-green-500 tabular-nums"
|
||||
/>
|
||||
<StatCard
|
||||
title="Due Soon"
|
||||
value={String(dueSoonCount)}
|
||||
|
||||
Reference in New Issue
Block a user