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