const html = require('choo/html'); module.exports = function(state, emit) { const file = state.storage.getFileById(state.params.id); const div = html`
`; function togglePasswordInput() { document.querySelector('.setPassword').classList.toggle('hidden'); } function setPassword(event) { event.preventDefault(); const password = document.getElementById('unlock-input').value; if (password.length > 0) { emit('password', { password, file }); } } return div; };