import React, { PropTypes } from 'react'; import classnames from 'classnames'; import notificationInterface from 'interfaces/notification'; import Icon from 'components/icons/Icon'; import Button from 'components/buttons/Button'; const baseClass = 'flash-message'; const FlashMessage = ({ fullWidth, notification, onRemoveFlash, onUndoActionClick }) => { const { alertType, isVisible, message, undoAction } = notification; const klass = classnames(baseClass, `${baseClass}--${alertType}`, { [`${baseClass}--full-width`]: fullWidth, }); if (!isVisible) { return false; } const alertIcon = alertType === 'success' ? 'success-check' : 'warning-filled'; return (
{message} {undoAction && }
); }; FlashMessage.propTypes = { fullWidth: PropTypes.bool, notification: notificationInterface, onRemoveFlash: PropTypes.func, onUndoActionClick: PropTypes.func, }; export default FlashMessage;