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

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;
