send/app/pages/uploads/index.js

19 lines
573 B
JavaScript
Raw Normal View History

2018-10-16 23:53:33 +00:00
const html = require('choo/html');
const controlArea = require('../../templates/controlArea');
const archiveTile = require('../../templates/archiveTile');
module.exports = function(state, emit) {
const fileArea = state.storage.files.length
? html`<ul class="myUploads">
${state.storage.files.map(f => archiveTile(f, state))}
</ul>`
: html`<div>nothing to see here</div>`;
return html`<main class="main">
${controlArea(state, emit)}
<div class="wide">
<h1>${state.translate('myUploads')}</h1>
${fileArea}
</div>
</main>`;
};