drop.chapril.org-firefoxsend/app/templates/fileList/index.js

36 lines
1.0 KiB
JavaScript
Raw Normal View History

const html = require('choo/html');
const file = require('../file');
module.exports = function(state, emit) {
let table = '';
if (state.storage.files.length) {
table = html`
<table class="fileList">
<thead>
<tr>
<th class="fileList__header fileList__nameCol">
${state.translate('uploadedFile')}
</th>
<th class="fileList__header fileList__copyCol">
2018-01-24 19:23:13 +01:00
${state.translate('copyFileList')}
</th>
<th class="fileList__header fileList__expireCol" >
2018-01-24 19:23:13 +01:00
${state.translate('timeFileList')}
</th>
<th class="fileList__header fileList__dlCol" >
2018-01-24 19:23:13 +01:00
${state.translate('downloadsFileList')}
</th>
<th class="fileList__header fileList__delCol">
2018-01-24 19:23:13 +01:00
${state.translate('deleteFileList')}
</th>
</tr>
</thead>
<tbody class="fileList__body">
${state.storage.files.map(f => file(f, state, emit))}
</tbody>
</table>
`;
}
return table;
};