'use client' import { useState, useEffect } from 'react' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { Button } from '@/components/ui/button' import { WifiOff, RefreshCw, Home, ShoppingCart } from 'lucide-react' import { motion } from 'framer-motion' import Link from 'next/link' export default function OfflinePage() { const [isOnline, setIsOnline] = useState(false) useEffect(() => { setIsOnline(navigator.onLine) const handleOnline = () => setIsOnline(true) const handleOffline = () => setIsOnline(false) window.addEventListener('online', handleOnline) window.addEventListener('offline', handleOffline) return () => { window.removeEventListener('online', handleOnline) window.removeEventListener('offline', handleOffline) } }, []) const handleRefresh = () => { window.location.reload() } return (
{isOnline ? 'Your internet connection has been restored. Click refresh to continue.' : 'It looks like you\'re not connected to the internet. Some features may not be available.' }
{!isOnline && ({isOnline ? 'Connection restored automatically.' : 'We\'ll automatically reconnect when your internet is back.' }