@@ -5,17 +5,17 @@ import { UpcomingLessons } from "@/components/dashboard/UpcomingLessons";
55import { SuggestedTutors } from "@/components/dashboard/SuggestedTutors" ;
66import { useOnError } from "@/hooks/error" ;
77import { router } from "@/lib/routes" ;
8- import EmptyStudentDashboard from "@litespace/assets/EmptyStudentDashboard" ;
98import { useMediaQuery } from "@litespace/headless/mediaQuery" ;
109import { useFindPersonalizedStudentStats } from "@litespace/headless/student" ;
1110import { Button } from "@litespace/ui/Button" ;
1211import { Loading } from "@litespace/ui/Loading" ;
13- import { Typography } from "@litespace/ui/Typography" ;
1412import { useFormatMessage } from "@litespace/ui/hooks/intl" ;
13+ import { Accordion } from "@litespace/ui/Accordion" ;
1514import { Web } from "@litespace/utils/routes" ;
16- import React , { useMemo } from "react" ;
15+ import React , { useMemo , useState } from "react" ;
1716import { Link } from "react-router-dom" ;
1817import { useTutors } from "@litespace/headless/tutor" ;
18+ import { Tabs } from "@litespace/ui/Tabs" ;
1919
2020const StudentDashboard : React . FC = ( ) => {
2121 const mq = useMediaQuery ( ) ;
@@ -62,6 +62,7 @@ const StudentDashboard: React.FC = () => {
6262 isPending = { query . isLoading }
6363 refetch = { query . refetch }
6464 />
65+ < Questions />
6566
6667 < PastLessons />
6768
@@ -90,9 +91,11 @@ const StudentDashboard: React.FC = () => {
9091 isPending = { query . isLoading }
9192 refetch = { query . refetch }
9293 />
93-
94+ < LearningApproachMobile />
95+ < div className = "flex-1" >
96+ < UpcomingLessons />
97+ </ div >
9498 < PastLessons />
95-
9699 < SuggestedTutors
97100 tutors = { dashboardTutor }
98101 loading = { tutors . query . isLoading }
@@ -103,9 +106,6 @@ const StudentDashboard: React.FC = () => {
103106 < div className = "flex-1 " >
104107 < ChatSummary />
105108 </ div >
106- < div className = "flex-1" >
107- < UpcomingLessons />
108- </ div >
109109 </ div >
110110 </ div >
111111 ) : null }
@@ -115,20 +115,144 @@ const StudentDashboard: React.FC = () => {
115115
116116const EmptyDashboard : React . FC = ( ) => {
117117 const intl = useFormatMessage ( ) ;
118+ const { md } = useMediaQuery ( ) ;
119+
120+ return (
121+ < div className = "my-auto md:my-12 flex flex-col gap-3 mx-auto p-4" >
122+ { md ? < Questions /> : null }
123+ { ! md ? < LearningApproachMobile /> : null }
124+ < Link to = { router . web ( { route : Web . Tutors , full : true } ) } tabIndex = { - 1 } >
125+ < Button
126+ className = "w-full md:max-w-[250px] mx-auto"
127+ type = "main"
128+ size = "large"
129+ >
130+ { intl ( "student-dashboard.empty-state.btn" ) }
131+ </ Button >
132+ </ Link >
133+ </ div >
134+ ) ;
135+ } ;
136+
137+ const Questions = ( ) => {
138+ const [ tab , setTab ] = useState ( "methodology" ) ;
139+ const intl = useFormatMessage ( ) ;
140+
141+ const tabs = useMemo (
142+ ( ) => [
143+ { id : "methodology" , label : intl ( "questions.methodology-tab" ) } ,
144+ { id : "benefits" , label : intl ( "questions.benefits-tab" ) } ,
145+ ] ,
146+ [ intl ]
147+ ) ;
148+
149+ return (
150+ < div className = "flex flex-col gap-2" >
151+ < div className = "md:max-w-max md:mx-auto" >
152+ < Tabs tabs = { tabs } setTab = { setTab } tab = { tab } />
153+ </ div >
154+ < div >
155+ { tab === "methodology" ? < Methodology /> : null }
156+ { tab === "benefits" ? < Benefits /> : null }
157+ </ div >
158+ </ div >
159+ ) ;
160+ } ;
161+
162+ const Methodology = ( ) => {
163+ const intl = useFormatMessage ( ) ;
164+ return (
165+ < div className = "px-4 grid gap-4 md:gap-8 md:grid-cols-3" >
166+ < div className = "border shadow-md rounded-2xl p-4" >
167+ < h2 className = "text-xl font-semibold mb-2 text-natural-700" >
168+ { intl ( "questions.methodology.card1.title" ) }
169+ </ h2 >
170+ < p className = "text-natural-600 leading-relaxed text-sm" >
171+ { intl ( "questions.methodology.card1.desc" ) }
172+ </ p >
173+ </ div >
174+
175+ < div className = "border shadow-md rounded-2xl p-4" >
176+ < h2 className = "text-xl font-semibold mb-2 text-natural-700" >
177+ { intl ( "questions.methodology.card2.title" ) }
178+ </ h2 >
179+ < p className = "text-natural-600 leading-relaxed text-sm" >
180+ { intl ( "questions.methodology.card2.desc" ) }
181+ </ p >
182+ </ div >
183+
184+ < div className = "border shadow-md rounded-2xl p-4" >
185+ < h2 className = "text-xl font-semibold mb-2 text-natural-700" >
186+ { intl ( "questions.methodology.card3.title" ) }
187+ </ h2 >
188+ < p className = "text-natural-600 leading-relaxed text-sm" >
189+ { intl ( "questions.methodology.card3.desc" ) }
190+ </ p >
191+ </ div >
192+ </ div >
193+ ) ;
194+ } ;
118195
196+ const Benefits = ( ) => {
197+ const intl = useFormatMessage ( ) ;
119198 return (
120- < div className = "my-auto flex flex-col gap-6 mx-auto" >
121- < EmptyStudentDashboard className = "w-[328px] h-[258px] md:w-[433px] md:h-[342px]" />
122- < div className = "flex flex-col gap-4 text-center w-max mx-auto" >
123- < Typography tag = "p" className = "text-subtitle-2 font-medium" >
124- { intl ( "student-dashboard.empty-state.desc" ) }
125- </ Typography >
126- < Link to = { router . web ( { route : Web . Tutors , full : true } ) } tabIndex = { - 1 } >
127- < Button className = "w-full" type = "main" size = "large" >
128- { intl ( "student-dashboard.empty-state.btn" ) }
129- </ Button >
130- </ Link >
199+ < div className = "px-4 grid gap-4 md:gap-8 md:grid-cols-3" >
200+ < div className = "border shadow-md rounded-2xl p-4" >
201+ < h2 className = "text-xl font-semibold mb-2 text-natural-700" >
202+ { intl ( "questions.benefits.card1.title" ) }
203+ </ h2 >
204+ < p className = "text-natural-600 leading-relaxed text-sm" >
205+ { intl ( "questions.benefits.card1.desc" ) }
206+ </ p >
207+ </ div >
208+
209+ < div className = "border shadow-md rounded-2xl p-4" >
210+ < h2 className = "text-xl font-semibold mb-2 text-natural-700" >
211+ { intl ( "questions.benefits.card2.title" ) }
212+ </ h2 >
213+ < p className = "text-natural-600 leading-relaxed text-sm" >
214+ { intl ( "questions.benefits.card2.desc" ) }
215+ </ p >
131216 </ div >
217+
218+ < div className = "border shadow-md rounded-2xl p-4" >
219+ < h2 className = "text-xl font-semibold mb-2 text-natural-700" >
220+ { intl ( "questions.benefits.card3.title" ) }
221+ </ h2 >
222+ < p className = "text-natural-600 leading-relaxed text-sm" >
223+ { intl ( "questions.benefits.card3.desc" ) }
224+ </ p >
225+ </ div >
226+ </ div >
227+ ) ;
228+ } ;
229+
230+ const LearningApproachMobile = ( ) => {
231+ const intl = useFormatMessage ( ) ;
232+
233+ const methodologyContent = intl ( "questions.methodology.mobile-content" ) ;
234+ const studentTipsContent = intl ( "questions.benefits.mobile-content" ) ;
235+
236+ const questions = [
237+ {
238+ title : intl ( "questions.methodology.mobile-title" ) ,
239+ content : methodologyContent ,
240+ } ,
241+ {
242+ title : intl ( "questions.benefits.mobile-title" ) ,
243+ content : studentTipsContent ,
244+ } ,
245+ ] ;
246+
247+ return (
248+ < div className = "block md:hidden" >
249+ < Accordion
250+ items = { questions . map ( ( { title, content } , i ) => ( {
251+ id : i . toString ( ) ,
252+ title,
253+ content,
254+ } ) ) }
255+ />
132256 </ div >
133257 ) ;
134258} ;
0 commit comments