import React from 'react' import PropTypes from 'prop-types' import { translate, Interpolate } from 'react-i18next' export class Alert extends React.Component { static propTypes = { alert: PropTypes.func.isRequired, removeAlert: PropTypes.func.isRequired, t: PropTypes.func.isRequired }; componentDidMount = () => { setTimeout(this.closeAlert, 5000) }; closeAlert = () => { const { removeAlert, alert } = this.props removeAlert(alert.id) }; onClose = (e) => { e.preventDefault() this.closeAlert() }; render () { const { alert } = this.props const interpolateParameters = alert.parameters || {} return (
) } } export default translate(['common'], { wait: true })(Alert)