@@ -114,6 +114,7 @@ export function LeetcodeDashboardTable({
114
114
const [ searchDifficulty , setSearchDifficulty ] = React . useState < string [ ] > ( [ ] ) ;
115
115
const [ searchTopic , setSearchTopic ] = React . useState < string [ ] > ( [ ] ) ;
116
116
const [ isFilterOpen , setIsFilterOpen ] = React . useState < boolean > ( false ) ;
117
+ const [ isLoading , setIsLoading ] = React . useState < boolean > ( false ) ;
117
118
118
119
const questionDifficulty = Object . values ( QuestionDifficulty ) . map ( ( q1 ) => {
119
120
return {
@@ -202,6 +203,7 @@ export function LeetcodeDashboardTable({
202
203
] ;
203
204
204
205
useEffect ( ( ) => {
206
+ setIsLoading ( true ) ;
205
207
getLeetcodeDashboardData (
206
208
pagination . pageIndex + 1 ,
207
209
pagination . pageSize ,
@@ -225,6 +227,7 @@ export function LeetcodeDashboardTable({
225
227
setData ( data . questions ) ;
226
228
}
227
229
} ) ;
230
+ setIsLoading ( false ) ;
228
231
} , [
229
232
refreshKey ,
230
233
pagination . pageIndex ,
@@ -249,7 +252,7 @@ export function LeetcodeDashboardTable({
249
252
return (
250
253
< div className = "w-full test" >
251
254
< div >
252
- < Table className = "font-light min-h-[40vh ]" >
255
+ < Table className = "font-light min-h-[280px ]" >
253
256
< TableHeader className = "w-full" >
254
257
< TableRow className = "text-white bg-primary-900 font-medium hover:bg-transparent h-[5rem] text-md" >
255
258
< TableCell colSpan = { 5 } className = "pl-10" >
@@ -344,7 +347,11 @@ export function LeetcodeDashboardTable({
344
347
< TableRow >
345
348
< TableCell colSpan = { columns . length } >
346
349
< div className = "w-full flex justify-center items-center" >
347
- < MoonLoader color = "#FFFFFF" size = "30" />
350
+ { isLoading ? (
351
+ < MoonLoader color = "#FFFFFF" size = "30" />
352
+ ) : (
353
+ < div className = "text-base" > No data found</ div >
354
+ ) }
348
355
</ div >
349
356
</ TableCell >
350
357
</ TableRow >
0 commit comments