const html = require('choo/html'); module.exports = function(state, emit) { return html` ${state.modal(state, emit, close)} `; function close(event) { if (event) { event.preventDefault(); event.stopPropagation(); } state.modal = null; emit('render'); } };