feat: add copy & download actions for modal

This commit is contained in:
divocat
2025-10-18 00:56:52 +03:00
parent d7235e8c06
commit fd64eb5bcb
5 changed files with 91 additions and 11 deletions

View File

@@ -0,0 +1,12 @@
export function copyToClipboard(text: string) {
const textarea = document.createElement('textarea');
textarea.value = text;
document.body.appendChild(textarea);
textarea.select();
try {
document.execCommand('copy');
} catch (_err) {
console.error('copyToClipboard - e', _err);
}
document.body.removeChild(textarea);
}