11'use client' ;
22
3- import { useState , useEffect } from 'react' ;
3+ import { useState , useEffect , Suspense } from 'react' ;
44import { useRouter , useSearchParams } from 'next/navigation' ;
55import Link from 'next/link' ;
66import { authService } from '../authService' ;
77
8- export default function ResetPasswordPage ( ) {
8+ function ResetPasswordContent ( ) {
99 const [ newPassword , setNewPassword ] = useState ( '' ) ;
1010 const [ confirmPassword , setConfirmPassword ] = useState ( '' ) ;
1111 const [ isLoading , setIsLoading ] = useState ( false ) ;
@@ -279,4 +279,37 @@ export default function ResetPasswordPage() {
279279 </ div >
280280 </ div >
281281 ) ;
282+ }
283+
284+ function LoadingFallback ( ) {
285+ return (
286+ < div className = "min-h-screen flex items-center justify-center bg-gradient-to-br from-blue-50 to-indigo-100 dark:from-gray-900 dark:to-gray-800 px-4" >
287+ < div className = "max-w-md w-full space-y-8" >
288+ < div className = "bg-white dark:bg-gray-800 rounded-2xl shadow-xl p-8" >
289+ < div className = "text-center" >
290+ < div className = "mx-auto flex items-center justify-center h-16 w-16 rounded-full bg-blue-100 dark:bg-blue-900 mb-6" >
291+ < svg className = "animate-spin h-8 w-8 text-blue-600 dark:text-blue-400" xmlns = "http://www.w3.org/2000/svg" fill = "none" viewBox = "0 0 24 24" >
292+ < circle className = "opacity-25" cx = "12" cy = "12" r = "10" stroke = "currentColor" strokeWidth = "4" > </ circle >
293+ < path className = "opacity-75" fill = "currentColor" d = "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" > </ path >
294+ </ svg >
295+ </ div >
296+ < h2 className = "text-2xl font-bold text-gray-900 dark:text-white mb-4" >
297+ Loading...
298+ </ h2 >
299+ < p className = "text-gray-600 dark:text-gray-400" >
300+ Please wait while we load the password reset page...
301+ </ p >
302+ </ div >
303+ </ div >
304+ </ div >
305+ </ div >
306+ ) ;
307+ }
308+
309+ export default function ResetPasswordPage ( ) {
310+ return (
311+ < Suspense fallback = { < LoadingFallback /> } >
312+ < ResetPasswordContent />
313+ </ Suspense >
314+ ) ;
282315}
0 commit comments