import _Modal from "./_Modal.js";

var Modal = function(){
  return {
    view: function(vnode){
      var active_class = (_Modal.component === null ? '' : '.active');
      return m('.modal'+active_class, [
        m('a.modal-overlay', {
          'aria-label':"Close",
          onclick: function(){ _Modal.close(); }
          }),
        m('.modal-container', [
          (_Modal.component === null ?
            ''
            :
            m(_Modal.component, _Modal.attrs)
            )
          ])
        ]);
      }
    };
  };

export default Modal;