'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 (

{isOnline ? "You're Back Online!" : "You're Offline"}

{isOnline ? (

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.

What you can do:

  • • View your cached lists and tasks
  • • Make changes that will sync later
  • • Check your connection and try again

Note about authentication:

Login and registration require an internet connection. If you need to sign in, please connect to the internet first.

)}
); }