'use strict'; var React = require('react'); var Dialog = require('rc-dialog'); var div; module.exports = function (props) { var d; props = props || {}; props.iconClassName = props.iconClassName || 'anticon-exclamation-circle'; props.animation = 'zoom'; props.maskAnimation = 'fade'; var width = props.width || 375; function close() { d.setState({ visible: false }); } function onCancel() { var cancelFn = props.onCancel; if (cancelFn) { if(cancelFn.length){ cancelFn(close); }else { cancelFn(); close(); } } else { close(); } } function onOk() { var okFn = props.onOk; if (okFn) { if(okFn.length){ okFn(close); }else { okFn(); close(); } } else { close(); } } var body =
{props.title}
{props.content}
; var footer =
; if (!div) { div = document.createElement('div'); document.body.appendChild(div); } React.render(
{body} {footer}
, div, function () { d = this; }); };