import React from 'react';
import './Modal.css'

export default props => {
  let modalStyles = [];
  let contentStyles = [];
  modalStyles.push('Modal');
  contentStyles.push('ModalContent');
  if (props.critical) {
    modalStyles.push('ModalCritical');
    contentStyles.push('ModalCritical');
  }

  return (
    <div
      className={modalStyles.join(' ')}
      onClick={props.clicked}>
      <div className={contentStyles.join(' ')}>
        {props.children}
      </div>
    </div>);
};