'use client' import { useState, useEffect } from 'react' import { useOfflineSync } from '@/hooks' import { WifiOff, Wifi, RefreshCw, AlertCircle } from 'lucide-react' /** * Offline indicator component * Shows connection status and sync progress * Validates: Requirements 4.5 */ export default function OfflineIndicator() { const [mounted, setMounted] = useState(false) const { isOnline, isSyncing, syncError, queueLength, triggerSync } = useOfflineSync() useEffect(() => { setMounted(true) }, []) // Don't render on server to avoid hydration mismatch if (!mounted) { return null } // Don't show anything if online and no pending syncs if (isOnline && queueLength === 0 && !syncError) { return null } return (