import React from 'react'; export default React.createClass({ getDefaultProps() { return { prefixCls: 'ant-alert' }; }, getInitialState() { return { display: 'block' }; }, handleClose(e) { if (this.props.onClose) { this.props.onClose.call(this, e); } this.setState({ display: 'none' }); }, render () { var iconClass = this.props.description ? 'ant-alert-with-description-icon anticon-' : 'ant-alert-icon anticon-'; switch (this.props.type) { case 'success': iconClass += 'check-circle'; break; case 'info': iconClass += 'info-circle'; break; case 'error': iconClass += 'exclamation-circle'; break; case 'warn': iconClass += 'question-circle'; break; default: iconClass += 'default'; } if (this.props.description) { let close = this.props.closable ? : ''; return (
{this.props.message}
{this.props.description} {close}