import { useEffect, useState } from 'react' import { CheckCircleIcon, InformationCircleIcon, XCircleIcon, } from '@heroicons/react/outline' import useMangoStore from '../stores/useMangoStore' const NotificationList = () => { const setMangoStore = useMangoStore((s) => s.set) const notifications = useMangoStore((s) => s.notifications) console.log('notifications', notifications) useEffect(() => { if (notifications.length > 0) { const id = setInterval(() => { setMangoStore((state) => { state.notifications = notifications.slice(1, notifications.length) }) }, 6000) return () => { clearInterval(id) } } }, [notifications, setMangoStore]) return (
{notifications.map((n, idx) => ( ))}
) } const Notification = ({ type, message, description, txid }) => { const [showNotification, setShowNotification] = useState(true) if (!showNotification) return null return (
{type === 'success' ? ( ) : null} {type === 'info' && ( )} {type === 'error' && ( )}

{message}

{description}

{txid ? (

{txid}

) : null}
) } export default NotificationList