const html = require('choo/html'); export default function mainPage(state, emit) { function clickPreferences(event) { event.preventDefault(); emit('pushState', '/preferences'); } function uploadFile(event) { event.preventDefault(); const target = event.target; const file = target.files[0]; if (file.size === 0) { return; } emit('pushState', '/options'); emit('addFiles', { files: [file] }); } return html`
`; }