1- " use client"
1+ ' use client' ;
22
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' ;
55
66export 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 ) ;
99
1010 useEffect ( ( ) => {
1111 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+ } , [ ] ) ;
1717
1818 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 " >
2121 < div className = "flex items-center space-x-2" >
2222 < Code className = "h-6 w-6" />
2323 < span className = "text-lg font-semibold" > PeerPrep</ span >
2424 </ div >
2525 < User className = "h-6 w-6" />
2626 </ 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 >
2929 < 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.
3233 </ p >
3334 < 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 " >
3536 < 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 } %` } }
3839 > </ div >
3940 </ div >
40- < div className = "text-sm text-center " >
41+ < div className = "text-center text-sm " >
4142 Time elapsed: { elapsedTime } seconds
4243 </ div >
4344 </ div >
4445 < div className = "flex items-center space-x-2 text-sm" >
4546 < User className = "h-4 w-4" />
4647 < span > { usersWaiting } users waiting</ span >
4748 </ 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" >
4950 Cancel Matching
5051 </ button >
51- < p className = "text-sm text-gray-500 mt-4 " >
52+ < p className = "mt-4 text-sm text-gray-500" >
5253 Tip: While you wait, why not review some coding concepts?
5354 </ p >
5455 </ main >
5556 </ div >
56- )
57- }
57+ ) ;
58+ }
0 commit comments