const html = require('choo/html'); const assets = require('../../common/assets'); const { list } = require('../utils'); const archiveTile = require('./archiveTile'); function intro(state) { return html`

${state.translate('uploadPageHeader')}
${state.translate('pageHeaderCredits')}

${state.translate( 'uploadPageExplainer' )}

`; } module.exports = function(state, emit) { const archives = state.storage.files.map(archive => archiveTile(state, emit, archive) ); let wip = ''; if (state.uploading) { wip = archiveTile.uploading(state, emit); } else if (state.archive) { wip = archiveTile.wip(state, emit); } else { wip = archiveTile.empty(state, emit); } archives.reverse(); if (archives.length < 1) { archives.push(intro(state)); } return html`
${wip}
${list(archives, 'list-reset h-full overflow-y-scroll foo', 'py-2')}
`; };