From d81357ead13859c707b62673ba067dfd7d8fb420 Mon Sep 17 00:00:00 2001 From: padreug Date: Tue, 11 Feb 2025 15:39:09 +0100 Subject: [PATCH] everything looks dopeee --- .../ui/message-bubble/MessageBubble.vue | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/components/ui/message-bubble/MessageBubble.vue b/src/components/ui/message-bubble/MessageBubble.vue index 4824621..f034471 100644 --- a/src/components/ui/message-bubble/MessageBubble.vue +++ b/src/components/ui/message-bubble/MessageBubble.vue @@ -64,15 +64,15 @@ const formatSpecialContent = (type: 'address' | 'txid' | 'invoice', value: strin const buttonClasses = 'inline-flex items-center gap-1 px-2 h-[22px] text-[11px] font-medium rounded bg-gray-800/20 hover:bg-gray-800/30 transition-colors' if (type === 'txid') { - return `
${value}
mempool.space
` + return `
${value}
mempool.space
` } if (type === 'address') { - return `
${value}
mempool.space
` + return `
${value}
mempool.space
` } if (type === 'invoice') { - return `
${value}
Pay
` + return `
${value}
Pay
` } return value @@ -118,14 +118,20 @@ const isJson = computed(() => { } }) -// Expose the copyToClipboard function to the window object for the onclick handlers -if (typeof window !== 'undefined') { - (window as any).copyToClipboard = copyToClipboard +const handleClick = async (event: MouseEvent) => { + const target = event.target as HTMLElement + const copyButton = target.closest('button[data-copy]') + if (copyButton) { + const textToCopy = copyButton.getAttribute('data-copy') + if (textToCopy) { + await copyToClipboard(textToCopy) + } + } }