const html = require('choo/html'); const progress = require('../templates/progress'); const { bytes } = require('../utils'); module.exports = function(state, emit) { const transfer = state.transfer; const div = html`
${state.translate('uploadingPageProgress', { filename: transfer.file.name, size: bytes(transfer.file.size) })}
${progress(transfer.progressRatio)}
${state.translate(transfer.msg, transfer.sizes)}
`; function cancel() { const btn = document.getElementById('cancel-upload'); btn.disabled = true; btn.textContent = state.translate('uploadCancelNotification'); emit('cancel'); } return div; };