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 ownedFile = state.storage.getFileById(state.params.id); const trySendLink = html` ${state.translate('sendYourFilesLink')} `; const cancelButton = html` `; const bottomLink = state.transfer.state === 'downloading' ? cancelButton : trySendLink; return html`
${titleSection(state)} ${downloadedFiles(ownedFile, state, emit)}
${state.translate('downloadMessage2')}
${downloadButton(state, emit)} ${bottomLink}
`; function cancel() { if (state.transfer.state === 'downloading') { emit('cancel'); } } };