'use client'; import { useEffect, useState } from 'react'; import { Box, Container, Typography, Button, Paper } from '@mui/material'; import { WifiOff, Refresh, Home } from '@mui/icons-material'; import { useRouter } from 'next/navigation'; export default function OfflinePage() { const router = useRouter(); const [isOnline, setIsOnline] = useState(false); useEffect(() => { // Check online status const handleOnline = () => setIsOnline(true); const handleOffline = () => setIsOnline(false); setIsOnline(navigator.onLine); window.addEventListener('online', handleOnline); window.addEventListener('offline', handleOffline); return () => { window.removeEventListener('online', handleOnline); window.removeEventListener('offline', handleOffline); }; }, []); useEffect(() => { // Redirect when back online if (isOnline) { router.push('/'); } }, [isOnline, router]); const handleRetry = () => { if (navigator.onLine) { router.push('/'); } else { window.location.reload(); } }; const handleGoHome = () => { router.push('/'); }; return ( You're Offline It looks like you've lost your internet connection. Some features may be limited while offline. What you can still do:
  • View previously loaded activities and data
  • Create new activities (will sync when back online)
  • Access cached pages and information
  • {isOnline && ( ✓ Connection restored! Redirecting... )}
    ); }