const html = require('choo/html'); const { copyToClipboard } = require('../utils'); const qr = require('./qr'); module.exports = function(name, url) { const dialog = function(state, emit, close) { return html`

${state.translate('notifyUploadEncryptDone')}

${state.translate('copyLinkDescription')}
${name}

`; function toggleQR(event) { event.stopPropagation(); const shareUrl = document.getElementById('share-url'); const qrBtn = document.getElementById('qr-btn'); if (shareUrl.classList.contains('hidden')) { shareUrl.classList.replace('hidden', 'block'); qrBtn.classList.replace('w-48', 'w-16'); } else { shareUrl.classList.replace('block', 'hidden'); qrBtn.classList.replace('w-16', 'w-48'); } } function copy(event) { event.stopPropagation(); copyToClipboard(url); event.target.textContent = state.translate('copiedUrl'); setTimeout(close, 1000); } }; dialog.type = 'copy'; return dialog; };