'use client'; import { useEffect, useState } from 'react'; export default function NotificationDebug() { const [debug, setDebug] = useState({}); useEffect(() => { const info = { notificationSupported: 'Notification' in window, serviceWorkerSupported: 'serviceWorker' in navigator, pushManagerSupported: 'PushManager' in window, permission: 'Notification' in window ? Notification.permission : 'N/A', localStorage: typeof localStorage !== 'undefined' ? localStorage.getItem('notification-prompt-dismissed') : 'N/A', }; setDebug(info); }, []); return (
Push Debug:
Notification: {debug.notificationSupported ? '✓' : '✗'}
ServiceWorker: {debug.serviceWorkerSupported ? '✓' : '✗'}
PushManager: {debug.pushManagerSupported ? '✓' : '✗'}
Permission: {debug.permission}
Dismissed: {debug.localStorage || 'No'}
); }