Module Update

This commit is contained in:
SpecialX
2025-12-30 14:42:30 +08:00
parent f1797265b2
commit e7c902e8e1
148 changed files with 19317 additions and 113 deletions

View File

@@ -0,0 +1,72 @@
"use client"
import { useEffect } from "react";
import { useRouter } from "next/navigation";
import { Button } from "@/shared/components/ui/button"
import Link from "next/link"
import { Shield, GraduationCap, Users, User } from "lucide-react"
// In a real app, this would be a server component that redirects based on session
// But for this demo/dev environment, we keep the manual selection or add auto-redirect logic if we had auth state.
export default function DashboardPage() {
// Mock Auth Logic (Optional: Uncomment to test auto-redirect)
/*
const router = useRouter();
useEffect(() => {
// const role = "teacher"; // Fetch from auth hook
// if (role) router.push(`/${role}/dashboard`);
}, []);
*/
return (
<div className="flex flex-col items-center justify-center min-h-[50vh] space-y-8">
<div className="text-center space-y-2">
<h1 className="text-3xl font-bold">Welcome to Next_Edu</h1>
<p className="text-muted-foreground">Select your role to view the corresponding dashboard.</p>
<p className="text-xs text-muted-foreground bg-muted p-2 rounded inline-block">
[DEV MODE] In production, you would be redirected automatically based on your login session.
</p>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
<Link href="/admin/dashboard">
<Button variant="outline" className="h-40 w-40 flex flex-col gap-4 hover:border-primary hover:bg-primary/5 transition-all">
<Shield className="h-10 w-10 text-primary" />
<div className="space-y-1">
<span className="font-semibold text-lg block">Admin</span>
<span className="text-xs text-muted-foreground font-normal">System Management</span>
</div>
</Button>
</Link>
<Link href="/teacher/dashboard">
<Button variant="outline" className="h-40 w-40 flex flex-col gap-4 hover:border-indigo-500 hover:bg-indigo-50 transition-all">
<GraduationCap className="h-10 w-10 text-indigo-600" />
<div className="space-y-1">
<span className="font-semibold text-lg block">Teacher</span>
<span className="text-xs text-muted-foreground font-normal">Class & Exams</span>
</div>
</Button>
</Link>
<Link href="/student/dashboard">
<Button variant="outline" className="h-40 w-40 flex flex-col gap-4 hover:border-emerald-500 hover:bg-emerald-50 transition-all">
<Users className="h-10 w-10 text-emerald-600" />
<div className="space-y-1">
<span className="font-semibold text-lg block">Student</span>
<span className="text-xs text-muted-foreground font-normal">My Learning</span>
</div>
</Button>
</Link>
<Link href="/parent/dashboard">
<Button variant="outline" className="h-40 w-40 flex flex-col gap-4 hover:border-amber-500 hover:bg-amber-50 transition-all">
<User className="h-10 w-10 text-amber-600" />
<div className="space-y-1">
<span className="font-semibold text-lg block">Parent</span>
<span className="text-xs text-muted-foreground font-normal">Family Overview</span>
</div>
</Button>
</Link>
</div>
</div>
)
}