'use client'; import React from 'react'; import { Indicator, ActionIcon, Popover, ScrollArea, Stack, Group, Text, Button, Center, Badge, } from '@mantine/core'; import { IconBell, IconInbox } from '@tabler/icons-react'; import { useNotificationCenter } from '../../hooks/useNotificationCenter'; import { NotificationItem } from '../NotificationItem'; interface NotificationBellProps { position?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end'; maxHeight?: number; emptyMessage?: string; } export function NotificationBell({ position = 'bottom-end', maxHeight = 400, emptyMessage = "You're all caught up!", }: NotificationBellProps) { const { isOpen, toggle, close, notifications, unreadCount, markAsRead, markAllAsRead, deleteNotification, } = useNotificationCenter(); return ( Notifications {unreadCount > 0 && ( {unreadCount} new )} {notifications.length > 0 && ( )} {notifications.length === 0 ? (
{emptyMessage}
) : ( {notifications.map((notification) => ( markAsRead(notification.id)} onDismiss={() => deleteNotification(notification.id)} /> ))} )}
); }