const html = require('choo/html'); const { list } = require('../../app/utils'); const archiveTile = require('../../app/ui/archiveTile'); const modal = require('../../app/ui/modal'); const intro = require('../../app/ui/intro'); const assets = require('../../common/assets'); module.exports = function(state, emit) { function onchange(event) { event.preventDefault(); const newFiles = Array.from(event.target.files); emit('addFiles', { files: newFiles }); } function onclick() { document.getElementById('file-upload').click(); } const archives = state.storage.files .filter(archive => !archive.expired) .map(archive => archiveTile(state, emit, archive)) .reverse(); let content = ''; let button = html`