11import { useMemo } from "react" ;
2- import LessonsTable from "../table/LessonsTable" ;
32import { Calendar } from "../calendar/Calendar" ;
43import { PageTitle } from "../pageTitle/PageTitle" ;
54import { NumberOfStudentsCard } from "./NumberOfStudentsCard" ;
65import { RequestStudentsCard } from "./RequestStudentsCard" ;
6+ import { LessonCard } from "./LessonCard" ;
77import { useTeacherAppointmentsQuery } from "../../features/appointments/query/useTeacherAppointmentsQuery" ;
88import { useRegularStudentsQuery } from "../../features/appointments/query/useRegularStudentsQuery" ;
99import { useAppointmentTime } from "../../features/appointments/hooks/useAppointmentTime" ;
@@ -37,7 +37,7 @@ export const MyLessonsSection = () => {
3737
3838 const today = new Date ( ) . toISOString ( ) . split ( "T" ) [ 0 ] ;
3939
40- const rows = useMemo ( ( ) => {
40+ const lessons = useMemo ( ( ) => {
4141 const appointments = data ?. appointments ?? [ ] ;
4242 return appointments
4343 . filter ( ( appointment ) => appointment . date === today )
@@ -46,16 +46,17 @@ export const MyLessonsSection = () => {
4646
4747 return {
4848 id : appointment . id ,
49- checked : appointment . status === "approved" ,
5049 lesson : appointment . lesson ,
5150 student : appointment . studentName || appointment . studentId || "N/A" ,
5251 price : appointment . price ,
52+ date : appointment . date ,
53+ time : appointment . time ,
5354 isPast,
5455 videoCall : (
5556 < Button
5657 as = "button"
5758 variant = "link"
58- className = "text-white underline text-[14px] md:text-[16px] hover:text-gray -300"
59+ className = "text-blue-400 underline text-[12px] hover:text-blue -300 transition-colors "
5960 onClick = { ( ) =>
6061 confirmStartCall (
6162 appointment . studentId ,
@@ -74,35 +75,39 @@ export const MyLessonsSection = () => {
7475 return (
7576 < div >
7677 < PageTitle title = "General" />
77- < div className = "mt-6 flex flex-col items-center justify-center gap-[40px ] lg:flex-row lg:justify-between" >
78+ < div className = "mt-6 flex flex-col items-center justify-center gap-[24px ] lg:flex-row lg:justify-between lg:gap-[40px] " >
7879 < NumberOfStudentsCard count = { regularStudentsCount } />
7980 < RequestStudentsCard count = { requestStudentsCount } />
8081 < Calendar />
8182 </ div >
8283
8384 < PageTitle title = "My lessons today" />
84- < div className = "mt-[28px ]" >
85+ < div className = "mt-[12px ]" >
8586 { isLoading ? (
8687 < div className = "py-8 text-center text-white" > Loading lessons...</ div >
8788 ) : error ? (
8889 < div className = "py-8 text-center text-white" >
8990 Error loading lessons
9091 </ div >
91- ) : rows . length === 0 ? (
92+ ) : lessons . length === 0 ? (
9293 < div className = "py-8 text-center text-white" >
9394 No lessons scheduled for today
9495 </ div >
9596 ) : (
96- < LessonsTable
97- height = { 290 }
98- columns = { [
99- { key : "lesson" , label : "Lessons" , width : "130px" } ,
100- { key : "student" , label : "Students" , width : "184px" } ,
101- { key : "price" , label : "Price" , width : "146px" } ,
102- { key : "videoCall" , label : "Video call" , width : "146px" } ,
103- ] }
104- rows = { rows }
105- />
97+ < div className = "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-[16px]" >
98+ { lessons . map ( ( lesson ) => (
99+ < LessonCard
100+ key = { lesson . id }
101+ lesson = { lesson . lesson }
102+ student = { lesson . student }
103+ price = { lesson . price }
104+ date = { lesson . date }
105+ time = { lesson . time }
106+ isPast = { lesson . isPast }
107+ videoCall = { lesson . videoCall }
108+ />
109+ ) ) }
110+ </ div >
106111 ) }
107112 </ div >
108113 </ div >
0 commit comments