import { useState } from 'react' import type { Notification } from '@/lib/notificationService' export function useNotificationCenter( markAsRead: (id: string) => void, onClose?: () => void ): { isOpen: boolean handleToggle: () => void handleClose: () => void handleNotificationClick: (notification: Notification) => void } { const [isOpen, setIsOpen] = useState(false) const handleToggle = (): void => { setIsOpen((prev) => !prev) } const handleClose = (): void => { setIsOpen(false) onClose?.() } const handleNotificationClick = (notification: Notification): void => { if (!notification.read) { markAsRead(notification.id) } handleClose() } return { isOpen, handleToggle, handleClose, handleNotificationClick, } }