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

{this.props.message}

{this.props.description}
); } else { if (this.props.closeText) { return (
{this.props.description} {this.props.closeText}
); } else { return (
{this.props.description}
); } } } });