| 123456789101112131415161718192021222324252627 |
- "use client";
- import DashboardContent from "@/components/DashboardContent";
- import TeacherDashboard from "@/components/TeacherDashboard";
- import { useAuth } from "@/components/AuthProvider";
- import { Loader2 } from "lucide-react";
- export default function Home() {
- const { user, isLoading } = useAuth();
- if (isLoading) {
- return (
- <div className="flex-1 h-full w-full flex items-center justify-center p-8 text-secondary">
- <Loader2 className="w-10 h-10 animate-spin mr-3 text-primary" />
- <span className="font-bold text-lg animate-pulse">正在验证身份与加载数据门户...</span>
- </div>
- );
- }
- // Teacher specific view spanning aggregate stats
- if (user?.role === "teacher") {
- return <TeacherDashboard />;
- }
- // Fallback to default granular student view
- return <DashboardContent />;
- }
|