import { XIcon } from 'lucide-react'; import { AnimatePresence, motion } from 'motion/react'; import { Card } from '#components'; import { useNotificationsStore, useTranslation } from '#hooks'; import { NotificationIcon } from './NotificationIcon.tsx'; type NotificationHubProps = { /** The number of milliseconds before the notification is automatically cleared */ timeout?: number; }; const NotificationHub = ({ timeout = 5000 }: NotificationHubProps) => { const { t } = useTranslation('libui'); const { dismissNotification, notifications } = useNotificationsStore(); return (
{notifications.map((item) => (
{item.title ?? t(`notifications.types.${item.type}`)}

{item.message}

{ dismissNotification(item.id); }} />
))}
); }; export { NotificationHub, type NotificationHubProps };