import React, { FC } from 'react' import { useSelector, useDispatch } from 'react-redux' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faDoorOpen } from '@fortawesome/free-solid-svg-icons' import { setNotificationAuto, removeNotification } from '../actions/notifications' import { getNotifications } from '../selectors' import Notification from './notification' const NotificationContainer: FC = () => { const notifications = useSelector(getNotifications) const dispatch = useDispatch() const setAuto = (id: string) => { dispatch(setNotificationAuto(id)) } const dismiss = (id: string) => { dispatch(removeNotification(id)) } return (
{notifications.map(notification => { const content = () => { switch (notification.type) { case 'welcome': return (

   {notification.content}

) default: return {notification.content} } } return ( {content()} ) })}
) } export default NotificationContainer