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