(content: string | Blob)
| 91 | * Copy content to clipboard |
| 92 | */ |
| 93 | export async function copyToClipboard(content: string | Blob): Promise<void> { |
| 94 | if (content instanceof Blob) { |
| 95 | // For images, use clipboard API |
| 96 | await navigator.clipboard.write([ |
| 97 | new ClipboardItem({ |
| 98 | [content.type]: content |
| 99 | }) |
| 100 | ]) |
| 101 | } else { |
| 102 | await navigator.clipboard.writeText(content) |
| 103 | } |
| 104 | } |