import { h, Component } from 'preact'

export default class Modal extends Component {
  constructor(props) {
    super()
  }
  render() {
    const className = this.props.visible ? 'modal visible' : 'modal'
    return (
      <div class={className}>
        <div class='inner'>
          {this.props.children}
        </div>
        <div class='close' onClick={this.props.onClose}>
          &times;
        </div>
      </div>
    )
  }
}
