import SimpleNotice from 'components/notice/index.jsx'; import NoticeAction from 'components/notice/notice-action'; import React from 'react'; import './style.scss'; /** * NoticesList component * * @param {*} props - Props * @return {React.Component} - NoticesList component */ export default function NoticesList( props = { handleLocalNoticeDismissClick: null, notices: Object.freeze( [] ) } ) { const noticesList = props.notices.map( function ( notice ) { const onDismissClick = theNotice => () => { theNotice && props.handleLocalNoticeDismissClick( theNotice.id ); }; return ( { notice.button && ( { notice.button } ) } ); } ); if ( ! noticesList.length ) { return null; } return (
{ noticesList }
); }