import React from 'react';

export default function ModalDialog (props) {
  const visible = props.visible ? 'visible' : ''
  function cancel (e) {
    e.stopPropagation()
  }
  return (
    <div className={'modal ' + visible} onClick={props.onClose}>
      <div className='inner' onClick={cancel}>
        {props.children}
        <div className='close' onClick={props.onClose}>x</div>
      </div>
    </div>
  )
}
