Switch to version 1: remove src/app/teacher-dashboard/page.tsx
This commit is contained in:
@@ -1,277 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||
import { useState } from "react";
|
||||
import {
|
||||
Home,
|
||||
Calendar,
|
||||
Users,
|
||||
MessageSquare,
|
||||
DollarSign,
|
||||
BarChart3,
|
||||
Settings,
|
||||
LogOut,
|
||||
Menu,
|
||||
X,
|
||||
Star,
|
||||
Clock,
|
||||
AlertCircle,
|
||||
CheckCircle,
|
||||
} from "lucide-react";
|
||||
|
||||
export default function TeacherDashboard() {
|
||||
const [activeMenu, setActiveMenu] = useState("home");
|
||||
const [sidebarOpen, setSidebarOpen] = useState(true);
|
||||
|
||||
const menuItems = [
|
||||
{ id: "home", label: "Home", icon: Home },
|
||||
{ id: "calendar", label: "Calendar", icon: Calendar },
|
||||
{ id: "students", label: "My Students", icon: Users },
|
||||
{ id: "messages", label: "Messages", icon: MessageSquare },
|
||||
{ id: "earnings", label: "Earnings", icon: DollarSign },
|
||||
{ id: "statistics", label: "Statistics", icon: BarChart3 },
|
||||
{ id: "settings", label: "Settings", icon: Settings },
|
||||
];
|
||||
|
||||
const monthlyStats = {
|
||||
earnings: "$4,280", lessons: 24,
|
||||
rating: 4.9,
|
||||
newStudents: 5,
|
||||
};
|
||||
|
||||
const todayLessons = [
|
||||
{
|
||||
id: 1,
|
||||
studentName: "John Doe", subject: "Mathematics", time: "09:00 AM", duration: "1 hour", status: "upcoming"},
|
||||
{
|
||||
id: 2,
|
||||
studentName: "Sarah Smith", subject: "Physics", time: "10:30 AM", duration: "1 hour", status: "upcoming"},
|
||||
{
|
||||
id: 3,
|
||||
studentName: "Mike Johnson", subject: "English", time: "02:00 PM", duration: "45 minutes", status: "upcoming"},
|
||||
];
|
||||
|
||||
const pendingRequests = [
|
||||
{
|
||||
id: 1,
|
||||
studentName: "Emma Wilson", subject: "Chemistry", message: "Requesting trial lesson", requestDate: "2 hours ago"},
|
||||
{
|
||||
id: 2,
|
||||
studentName: "Alex Brown", subject: "Biology", message: "Requesting regular classes", requestDate: "5 hours ago"},
|
||||
{
|
||||
id: 3,
|
||||
studentName: "Jordan Lee", subject: "Mathematics", message: "Requesting intensive tutoring", requestDate: "1 day ago"},
|
||||
];
|
||||
|
||||
const MenuItem = ({ item }: any) => {
|
||||
const Icon = item.icon;
|
||||
const isActive = activeMenu === item.id;
|
||||
return (
|
||||
<button
|
||||
onClick={() => setActiveMenu(item.id)}
|
||||
className={`w-full flex items-center gap-3 px-4 py-3 rounded-lg transition-all duration-200 ${
|
||||
isActive
|
||||
? "bg-primary-cta text-white"
|
||||
: "text-foreground hover:bg-card"
|
||||
}`}
|
||||
>
|
||||
<Icon size={20} />
|
||||
{sidebarOpen && <span>{item.label}</span>}
|
||||
</button>
|
||||
);
|
||||
};
|
||||
|
||||
const StatCard = ({ label, value, icon: Icon }: any) => (
|
||||
<div className="bg-card rounded-lg p-6 border border-background-accent">
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<p className="text-foreground/60 text-sm">{label}</p>
|
||||
<p className="text-3xl font-bold text-foreground mt-2">{value}</p>
|
||||
</div>
|
||||
<Icon size={32} className="text-primary-cta opacity-50" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
const LessonCard = ({ lesson }: any) => (
|
||||
<div className="bg-card rounded-lg p-4 border border-background-accent hover:shadow-lg transition-shadow">
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="flex-1">
|
||||
<div className="flex items-center gap-2 mb-2">
|
||||
<h3 className="font-semibold text-foreground">{lesson.studentName}</h3>
|
||||
<span className="text-xs bg-primary-cta/10 text-primary-cta px-2 py-1 rounded">
|
||||
{lesson.subject}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-4 text-sm text-foreground/60">
|
||||
<div className="flex items-center gap-1">
|
||||
<Clock size={16} />
|
||||
{lesson.time}
|
||||
</div>
|
||||
<span>{lesson.duration}</span>
|
||||
</div>
|
||||
</div>
|
||||
<button className="px-4 py-2 bg-primary-cta text-white rounded-lg hover:bg-primary-cta/90 transition-colors text-sm">
|
||||
Join
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
const RequestCard = ({ request }: any) => (
|
||||
<div className="bg-card rounded-lg p-4 border border-background-accent">
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="flex-1">
|
||||
<div className="flex items-center gap-2 mb-2">
|
||||
<h3 className="font-semibold text-foreground">{request.studentName}</h3>
|
||||
<span className="text-xs bg-secondary-cta/10 text-secondary-cta px-2 py-1 rounded">
|
||||
{request.subject}
|
||||
</span>
|
||||
</div>
|
||||
<p className="text-sm text-foreground/70 mb-2">{request.message}</p>
|
||||
<p className="text-xs text-foreground/50">{request.requestDate}</p>
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
<button className="p-2 bg-green-500/10 text-green-600 rounded-lg hover:bg-green-500/20 transition-colors">
|
||||
<CheckCircle size={18} />
|
||||
</button>
|
||||
<button className="p-2 bg-red-500/10 text-red-600 rounded-lg hover:bg-red-500/20 transition-colors">
|
||||
<X size={18} />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
return (
|
||||
<ThemeProvider
|
||||
defaultButtonVariant="text-shift"
|
||||
defaultTextAnimation="entrance-slide"
|
||||
borderRadius="rounded"
|
||||
contentWidth="compact"
|
||||
sizing="mediumSizeLargeTitles"
|
||||
background="none"
|
||||
cardStyle="layered-gradient"
|
||||
primaryButtonStyle="shadow"
|
||||
secondaryButtonStyle="layered"
|
||||
headingFontWeight="light"
|
||||
>
|
||||
<div className="flex h-screen bg-background">
|
||||
{/* Sidebar */}
|
||||
<div
|
||||
className={`${sidebarOpen ? "w-64" : "w-20"} bg-card border-r border-background-accent transition-all duration-300 flex flex-col`}
|
||||
>
|
||||
{/* Header */}
|
||||
<div className="p-4 flex items-center justify-between border-b border-background-accent">
|
||||
{sidebarOpen && (
|
||||
<h2 className="text-xl font-bold text-foreground">Dashboard</h2>
|
||||
)}
|
||||
<button
|
||||
onClick={() => setSidebarOpen(!sidebarOpen)}
|
||||
className="p-2 hover:bg-background rounded-lg transition-colors"
|
||||
>
|
||||
{sidebarOpen ? <X size={20} /> : <Menu size={20} />}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Menu Items */}
|
||||
<nav className="flex-1 p-4 space-y-2 overflow-y-auto">
|
||||
{menuItems.map((item) => (
|
||||
<MenuItem key={item.id} item={item} />
|
||||
))}
|
||||
</nav>
|
||||
|
||||
{/* Logout */}
|
||||
<div className="p-4 border-t border-background-accent">
|
||||
<button className="w-full flex items-center gap-3 px-4 py-3 text-red-600 hover:bg-red-500/10 rounded-lg transition-colors">
|
||||
<LogOut size={20} />
|
||||
{sidebarOpen && <span>Logout</span>}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Main Content */}
|
||||
<div className="flex-1 overflow-y-auto">
|
||||
<div className="p-8 max-w-7xl mx-auto">
|
||||
{/* Welcome Header */}
|
||||
<div className="mb-8">
|
||||
<h1 className="text-4xl font-bold text-foreground mb-2">
|
||||
Welcome back, Teacher!
|
||||
</h1>
|
||||
<p className="text-foreground/60">
|
||||
Here's your teaching dashboard for today
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Monthly Stats */}
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
|
||||
<StatCard
|
||||
label="Monthly Earnings"
|
||||
value={monthlyStats.earnings}
|
||||
icon={DollarSign}
|
||||
/>
|
||||
<StatCard
|
||||
label="Lessons This Month"
|
||||
value={monthlyStats.lessons}
|
||||
icon={Calendar}
|
||||
/>
|
||||
<StatCard
|
||||
label="Your Rating"
|
||||
value={`${monthlyStats.rating} ⭐`}
|
||||
icon={Star}
|
||||
/>
|
||||
<StatCard
|
||||
label="New Students"
|
||||
value={monthlyStats.newStudents}
|
||||
icon={Users}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Content Grid */}
|
||||
<div className="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
||||
{/* Today's Lessons */}
|
||||
<div className="lg:col-span-2">
|
||||
<div className="mb-6">
|
||||
<h2 className="text-2xl font-bold text-foreground mb-4">
|
||||
Today's Lessons
|
||||
</h2>
|
||||
<div className="space-y-4">
|
||||
{todayLessons.map((lesson) => (
|
||||
<LessonCard key={lesson.id} lesson={lesson} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Pending Requests */}
|
||||
<div>
|
||||
<div className="mb-6">
|
||||
<div className="flex items-center gap-2 mb-4">
|
||||
<h2 className="text-2xl font-bold text-foreground">
|
||||
Pending Requests
|
||||
</h2>
|
||||
<span className="text-xs bg-accent/10 text-accent px-2 py-1 rounded-full">
|
||||
{pendingRequests.length}
|
||||
</span>
|
||||
</div>
|
||||
<div className="space-y-4">
|
||||
{pendingRequests.length > 0 ? (
|
||||
pendingRequests.map((request) => (
|
||||
<RequestCard key={request.id} request={request} />
|
||||
))
|
||||
) : (
|
||||
<div className="bg-card rounded-lg p-6 border border-background-accent text-center">
|
||||
<AlertCircle size={32} className="mx-auto text-foreground/40 mb-2" />
|
||||
<p className="text-foreground/60">No pending requests</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user