You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1002 B
34 lines
1002 B
import React, { FC } from 'react'
|
|
import { Notification as INotification } from '../../types'
|
|
|
|
import Notification from '../notification'
|
|
|
|
import './notification-container.scss'
|
|
|
|
interface Props {
|
|
notifications: INotification[]
|
|
setAuto: (id: string) => void
|
|
dismiss: (id: string) => void
|
|
}
|
|
|
|
const NotificationContainer: FC<Props> = ({ notifications, setAuto, dismiss }) => {
|
|
return (
|
|
<div id="notification-container">
|
|
{notifications.map(notification => {
|
|
return (
|
|
<Notification
|
|
key={notification.id}
|
|
id={notification.id}
|
|
type={notification.type}
|
|
auto={notification.auto}
|
|
setAuto={setAuto}
|
|
dismiss={dismiss}>
|
|
{notification.content}
|
|
</Notification>
|
|
)
|
|
})}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default NotificationContainer
|