feat: integrate PWA support using next-pwa; update configuration in next.config.ts, add service worker files to .gitignore, and include manifest in layout.tsx
This commit is contained in:
17
components/OfflineBanner.tsx
Normal file
17
components/OfflineBanner.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
'use client';
|
||||
|
||||
import { useOnlineStatus } from '@/lib/hooks/useOnlineStatus';
|
||||
import { FiWifiOff } from 'react-icons/fi';
|
||||
|
||||
export function OfflineBanner() {
|
||||
const isOnline = useOnlineStatus();
|
||||
|
||||
if (isOnline) return null;
|
||||
|
||||
return (
|
||||
<div className="bg-yellow-500/10 border-b border-yellow-500/20 text-yellow-600 px-4 py-2 text-sm flex items-center justify-center gap-2 font-medium z-50 relative">
|
||||
<FiWifiOff className="w-4 h-4" />
|
||||
<span>You are currently offline. Changes may not be saved.</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user