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