From 417a5b22fb543d072bfb9b3ea6d9951d5759f7f2 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 21:46:59 +0000 Subject: [PATCH] Update src/app/teacher-dashboard/page.tsx --- src/app/teacher-dashboard/page.tsx | 383 +++++++++++------------------ 1 file changed, 142 insertions(+), 241 deletions(-) diff --git a/src/app/teacher-dashboard/page.tsx b/src/app/teacher-dashboard/page.tsx index ef67cec..e7e7c24 100644 --- a/src/app/teacher-dashboard/page.tsx +++ b/src/app/teacher-dashboard/page.tsx @@ -1,148 +1,50 @@ "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"; +import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; +import { LineChart, Line, BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Legend } from "recharts"; -export default function TeacherDashboard() { - const [activeMenu, setActiveMenu] = useState("home"); - const [sidebarOpen, setSidebarOpen] = useState(true); +const TeacherDashboard = () => { + const [comments, setComments] = useState>([]); + const [newComment, setNewComment] = useState(""); + const [newCommentName, setNewCommentName] = useState(""); - 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 }, + // Monthly earning data + const earningData = [ + { month: "Ocak", earning: 2400 }, + { month: "Şubat", earning: 3200 }, + { month: "Mart", earning: 2800 }, + { month: "Nisan", earning: 3900 }, + { month: "Mayıs", earning: 4200 }, + { month: "Haziran", earning: 3800 }, ]; - const monthlyStats = { - earnings: "$4,280", lessons: 24, - rating: 4.9, - newStudents: 5, + // Student count data + const studentData = [ + { month: "Ocak", students: 15 }, + { month: "Şubat", students: 22 }, + { month: "Mart", students: 28 }, + { month: "Nisan", students: 35 }, + { month: "Mayıs", students: 42 }, + { month: "Haziran", students: 45 }, + ]; + + const handleAddComment = () => { + if (newComment.trim() && newCommentName.trim()) { + setComments([ + ...comments, + { + id: Date.now().toString(), + name: newCommentName, + text: newComment, + date: new Date().toLocaleDateString("tr-TR"), + }, + ]); + setNewComment(""); + setNewCommentName(""); + } }; - 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 ( - - ); - }; - - const StatCard = ({ label, value, icon: Icon }: any) => ( -
-
-
-

{label}

-

{value}

-
- -
-
- ); - - const LessonCard = ({ lesson }: any) => ( -
-
-
-
-

{lesson.studentName}

- - {lesson.subject} - -
-
-
- - {lesson.time} -
- {lesson.duration} -
-
- -
-
- ); - - const RequestCard = ({ request }: any) => ( -
-
-
-
-

{request.studentName}

- - {request.subject} - -
-

{request.message}

-

{request.requestDate}

-
-
- - -
-
-
- ); - return ( -
- {/* Sidebar */} -
+
+
{/* Header */} -
- {sidebarOpen && ( -

Dashboard

- )} - +
+

Öğretmen Kontrol Paneli

+

Aylık kazanç, öğrenci sayısı ve yorumları takip edin

- {/* Menu Items */} - + {/* Charts Grid */} +
+ {/* Monthly Earning Chart */} +
+

Aylık Kazançlar

+ + + + + + `₺${value}`} + /> + + + + +
- {/* Logout */} -
- + {/* Student Count Chart */} +
+

Öğrenci Sayısı Artışı

+ + + + + + `${value} öğrenci`} + /> + + + + +
-
- {/* Main Content */} -
-
- {/* Welcome Header */} -
-

- Welcome back, Teacher! -

-

- Here's your teaching dashboard for today -

+ {/* Comments Section */} +
+

Öğrenci Yorumları

+ + {/* Add Comment Form */} +
+

Yeni Yorum Ekle

+
+ setNewCommentName(e.target.value)} + className="w-full px-4 py-2 border border-slate-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 text-slate-900 placeholder-slate-500" + /> +