"use client"; import { BookOpen, GraduationCap, TrendingUp } from "lucide-react"; import { useStudentDashboard } from "@/lib/api"; import { DashboardShell } from "@/shared/components/dashboard/dashboard-shell"; import { DashboardSection } from "@/shared/components/dashboard/dashboard-section"; import { StatCard } from "@/shared/components/ui/stat-card"; import { Card, CardContent } from "@/shared/components/ui/card"; /** * 学生仪表盘(ARCHITECTURE.md §7.1 / §10 P1-2) * * 改接 data-ana 的 studentDashboard 真实聚合查询,替换原 * grades/homeworks/schedule/exams 假契约 widget 查询。 * * 关联:ARCHITECTURE.md §5.5 / §10 P1-2 */ export default function StudentDashboardPage(): React.ReactElement { const { data, loading, error } = useStudentDashboard(); if (loading) { return (
{Array.from({ length: 4 }).map((_, i) => ( ))}
); } if (error || !data) { return ( 仪表盘数据加载失败,请稍后重试。 ); } return ( 0} /> } > {data.weak_points ? (
{data.weak_points.title ?? "--"} 掌握度 {data.weak_points.mastery?.toFixed(1) ?? "--"}%

错误次数:{data.weak_points.error_count ?? 0}

) : (

暂无薄弱知识点数据

)}
{data.recent_trends ? (
{data.recent_trends.date ?? "--"}: {data.recent_trends.score?.toFixed(1) ?? "--"} 分
) : (

暂无趋势数据

)}
); }