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