'use client'; import { WifiOff } from 'lucide-react'; import { useEffect, useState } from 'react'; import { useRouter } from 'next/navigation'; export default function OfflinePage() { const [isOnline, setIsOnline] = useState(false); const router = useRouter(); useEffect(() => { // Check if we're back online const handleOnline = () => { setIsOnline(true); // Automatically redirect after a short delay setTimeout(() => { router.push('/'); }, 1000); }; window.addEventListener('online', handleOnline); return () => { window.removeEventListener('online', handleOnline); }; }, [router]); return (
Your connection has been restored. Redirecting...
) : ( <>It looks like you've lost your internet connection. Don't worry, your data is safe and will sync when you're back online.
Login and registration require an internet connection. If you need to sign in, please connect to the internet first.