1
- " use client"
1
+ ' use client' ;
2
2
3
- import { useState , useEffect } from " react"
4
- import { User , Code } from " lucide-react"
3
+ import { useState , useEffect } from ' react' ;
4
+ import { User , Code } from ' lucide-react' ;
5
5
6
6
export default function LoadingPage ( ) {
7
- const [ elapsedTime , setElapsedTime ] = useState ( 0 )
8
- const [ usersWaiting , setUsersWaiting ] = useState ( 4 )
7
+ const [ elapsedTime , setElapsedTime ] = useState ( 0 ) ;
8
+ const [ usersWaiting , setUsersWaiting ] = useState ( 4 ) ;
9
9
10
10
useEffect ( ( ) => {
11
11
const timer = setInterval ( ( ) => {
12
- setElapsedTime ( ( prevTime ) => prevTime + 1 )
13
- } , 1000 )
14
-
15
- return ( ) => clearInterval ( timer )
16
- } , [ ] )
12
+ setElapsedTime ( ( prevTime ) => prevTime + 1 ) ;
13
+ } , 1000 ) ;
14
+ setUsersWaiting ( 5 ) ;
15
+ return ( ) => clearInterval ( timer ) ;
16
+ } , [ ] ) ;
17
17
18
18
return (
19
- < div className = "min-h-screen bg-[#1a1f2e] text-gray-300 flex flex-col " >
20
- < header className = "p-4 flex justify-between items-center border-b border-gray-700" >
19
+ < div className = "flex min-h-screen flex-col bg-[#1a1f2e] text-gray-300" >
20
+ < header className = "flex items-center justify-between border-b border-gray-700 p-4 " >
21
21
< div className = "flex items-center space-x-2" >
22
22
< Code className = "h-6 w-6" />
23
23
< span className = "text-lg font-semibold" > PeerPrep</ span >
24
24
</ div >
25
25
< User className = "h-6 w-6" />
26
26
</ header >
27
- < main className = "flex-grow flex flex -col items-center justify-center px-4 space-y-6" >
28
- < div className = "animate-spin rounded-full h-16 w-16 border-t -4 border-b -4 border-purple-500" > </ div >
27
+ < main className = "flex flex -grow flex-col items-center justify-center space-y-6 px-4 " >
28
+ < div className = "h-16 w-16 animate-spin rounded-full border-b -4 border-t -4 border-purple-500" > </ div >
29
29
< h1 className = "text-2xl font-bold text-white" > Finding a match</ h1 >
30
- < p className = "text-sm text-center max-w-md" >
31
- We're pairing you with another coder. This may take a few moments.
30
+ < p className = "max-w-md text-center text-sm" >
31
+ We're pairing you with another coder. This may take a few
32
+ moments.
32
33
</ p >
33
34
< div className = "w-full max-w-md space-y-2" >
34
- < div className = "h-1 bg-gray-700 rounded-full overflow-hidden " >
35
+ < div className = "h-1 overflow-hidden rounded-full bg-gray-700 " >
35
36
< div
36
- className = "h-full bg-purple-500 rounded-full "
37
- style = { { width : `${ ( elapsedTime % 60 ) / 60 * 100 } %` } }
37
+ className = "h-full rounded-full bg-purple-500"
38
+ style = { { width : `${ ( ( elapsedTime % 60 ) / 60 ) * 100 } %` } }
38
39
> </ div >
39
40
</ div >
40
- < div className = "text-sm text-center " >
41
+ < div className = "text-center text-sm " >
41
42
Time elapsed: { elapsedTime } seconds
42
43
</ div >
43
44
</ div >
44
45
< div className = "flex items-center space-x-2 text-sm" >
45
46
< User className = "h-4 w-4" />
46
47
< span > { usersWaiting } users waiting</ span >
47
48
</ div >
48
- < button className = "px-4 py-2 bg-purple-600 text-white rounded-md hover:bg-purple-700 transition-colors w-full max-w-md " >
49
+ < button className = "w-full max-w-md rounded-md bg-purple-600 px-4 py-2 text-white transition-colors hover:bg-purple-700" >
49
50
Cancel Matching
50
51
</ button >
51
- < p className = "text-sm text-gray-500 mt-4 " >
52
+ < p className = "mt-4 text-sm text-gray-500" >
52
53
Tip: While you wait, why not review some coding concepts?
53
54
</ p >
54
55
</ main >
55
56
</ div >
56
- )
57
- }
57
+ ) ;
58
+ }
0 commit comments