import React, { useState } from 'react'; import { useNotifications } from '../NotificationContext'; export const NotificationBell: React.FC = () => { const { notifications, unreadCount, markAsRead } = useNotifications(); const [isOpen, setIsOpen] = useState(false); return (
{isOpen && (

Notifications

{unreadCount} unread
{notifications.length === 0 ? (
No notifications yet
) : ( notifications.map(n => (
markAsRead(n.id)} >
{n.type === 'assignment' ? '📋' : n.type === 'mention' ? '💬' : '🔔'}

{n.title}

{n.message}

{new Date(n.created_at).toLocaleString()}

{!n.is_read &&
}
)) )}
)}
); };