import React, { Component } from 'react';
import PropTypes from 'prop-types';
import DialogBody from './DialogBody';

/**
 * 弹出框
 *
 * @class Dialog
 * @extends {Component}
 */
class Dialog extends Component {
  render() {
    const { visible, ...rest } = this.props;
    if (!visible){
      return null;
    }
    return <DialogBody {...rest} />;
  }
}

Dialog.propTypes = {
  visible: PropTypes.bool
};

export default Dialog;
