import { useState, useRef, useEffect } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { NotificationsPanel } from './notifications-panel'; import { BellIcon } from '@heroicons/react/24/outline'; import { useClickOutside } from '@web/src/hooks/useClickOutside'; interface NotificationsDropdownProps { notifications: number; notificationItems: Array; } export function NotificationsDropdown({ notifications, notificationItems }: NotificationsDropdownProps) { const [showNotifications, setShowNotifications] = useState(false); const notificationRef = useRef(null); useClickOutside(notificationRef, () => setShowNotifications(false)); return (
setShowNotifications(!showNotifications)} > {notifications > 0 && ( {notifications} )} {showNotifications && ( )}
); }