import { Fragment, useState } from 'react' import { Badge } from 'antd' import IonIcon from '@sentre/antd-ionicon' import MenuItem from '../components/menuItem' import Notification from 'view/notification' import { MenuSystemItem } from '../constants' import { useUnreadCount } from 'hooks/useNotifications' type NotificationsProps = { visible?: boolean } const HIDDEN_BADGE = 0 const Notifications = ({ visible }: NotificationsProps) => { const [open, setOpen] = useState(false) const unreadCount = useUnreadCount() return ( } value={MenuSystemItem.Notify} onClick={() => setOpen(true)} name={visible} postfix={ unreadCount ? (
{unreadCount}
) : null } tooltip > {MenuSystemItem.Notify}
setOpen(false)} />
) } export default Notifications