const html = require('choo/html'); const titleSection = require('../../templates/title'); const downloadButton = require('../../templates/downloadButton'); const downloadedFiles = require('../../templates/uploadedFileList'); module.exports = function(state, emit) { const storageFile = state.storage.getFileById(state.params.id); const multifiles = Array.from(storageFile.manifest.files); const trySendLink = html` ${state.translate('sendYourFilesLink')} `; const cancelButton = html` `; const bottomLink = state.transfer.state === 'downloading' ? cancelButton : trySendLink; return html`
${titleSection(state)} ${downloadedFiles(multifiles, state, emit)}
${state.translate('downloadMessage2')}
${downloadButton(state, emit)} ${bottomLink}
`; function cancel() { if (state.transfer.state === 'downloading') { emit('cancel'); } } };