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