components.common.Notifications.js Maven / Gradle / Ivy
import Notification from './Notification'
import Report from '../../helpers/report';
const Notifications = ({reports}) => {
if (!reports.every(Report.isReport))
throw new TypeError("Notifications can only be created from reports")
// create the notification
const toNotification = (error, index) => (
)
// render all reports as notifications
return (
{reports.map(toNotification)}
)
}
export default Notifications