'use client'; import { usePushNotifications } from '@/hooks/usePushNotifications'; import { Bell, BellOff } from 'lucide-react'; export default function NotificationSettings() { const { permission, isSubscribed, isLoading, error, subscribe, unsubscribe } = usePushNotifications(); const handleToggle = async () => { if (isSubscribed) { await unsubscribe(); } else { await subscribe(); } }; // Don't show if notifications aren't supported if (!('Notification' in window) || !('serviceWorker' in navigator)) { return null; } return (

{isSubscribed ? : } Push Notifications

Get notified when someone adds items, shares lists, or invites you to collaborate

{permission === 'denied' && (

Notifications are blocked. Please enable them in your browser settings.

)} {error && (

{error}

)} {isSubscribed && (

✓ You'll receive notifications on this device

)}

💡 Tip: Install this app to your home screen for the best notification experience

); }