2017-08-24 23:54:02 +02:00
|
|
|
const html = require('choo/html');
|
|
|
|
const file = require('./file');
|
|
|
|
|
|
|
|
module.exports = function(state, emit) {
|
|
|
|
let table = '';
|
|
|
|
if (state.storage.files.length) {
|
|
|
|
table = html`
|
|
|
|
<table id="uploaded-files">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th id="uploaded-file">${state.translate('uploadedFile')}</th>
|
2017-09-06 23:09:17 +02:00
|
|
|
<th id="copy-file-list" class="center-col">${state.translate(
|
|
|
|
'copyFileList'
|
|
|
|
)}</th>
|
2017-08-24 23:54:02 +02:00
|
|
|
<th id="expiry-file-list">${state.translate('expiryFileList')}</th>
|
2017-09-06 23:09:17 +02:00
|
|
|
<th id="delete-file-list" class="center-col">${state.translate(
|
|
|
|
'deleteFileList'
|
|
|
|
)}</th>
|
2017-08-24 23:54:02 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
${state.storage.files.map(f => file(f, state, emit))}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
`;
|
|
|
|
}
|
|
|
|
return html`
|
|
|
|
<div id="file-list">
|
|
|
|
${table}
|
|
|
|
</div>
|
|
|
|
`;
|
|
|
|
};
|