diff --git a/app/components/messages/ChatItem.vue b/app/components/messages/ChatItem.vue index 0bdc273..c4f2d61 100644 --- a/app/components/messages/ChatItem.vue +++ b/app/components/messages/ChatItem.vue @@ -130,11 +130,24 @@ const lastMessagePreview = computed(() => { return '' }) +const toast = useToast() const copyToClipboard = async (text: string) => { try { await navigator.clipboard.writeText(text) + toast.add({ + title: 'Copiado al portapapeles', + icon: 'i-lucide-check', + color: 'success', + timeout: 2000 + }) } catch (err) { console.error('Failed to copy:', err) + toast.add({ + title: 'Error al copiar', + icon: 'i-lucide-x', + color: 'error', + timeout: 2000 + }) } } diff --git a/app/components/messages/MessageBubble.vue b/app/components/messages/MessageBubble.vue index 239a4ed..92cbdf9 100644 --- a/app/components/messages/MessageBubble.vue +++ b/app/components/messages/MessageBubble.vue @@ -316,11 +316,24 @@ const formatTime = (date: Date) => { }) } +const toast = useToast() const copyToClipboard = async (text: string) => { try { await navigator.clipboard.writeText(text) + toast.add({ + title: 'Copiado al portapapeles', + icon: 'i-lucide-check', + color: 'success', + timeout: 2000 + }) } catch (err) { console.error('Failed to copy:', err) + toast.add({ + title: 'Error al copiar', + icon: 'i-lucide-x', + color: 'error', + timeout: 2000 + }) } } diff --git a/app/pages/messages/index.vue b/app/pages/messages/index.vue index f2b79fd..a57fb05 100644 --- a/app/pages/messages/index.vue +++ b/app/pages/messages/index.vue @@ -472,11 +472,24 @@ watch(messages, () => { }, { deep: true }) // Copy to clipboard function +const toast = useToast() const copyToClipboard = async (text: string) => { try { await navigator.clipboard.writeText(text) + toast.add({ + title: 'Copiado al portapapeles', + icon: 'i-lucide-check', + color: 'success', + timeout: 2000 + }) } catch (err) { console.error('Failed to copy:', err) + toast.add({ + title: 'Error al copiar', + icon: 'i-lucide-x', + color: 'error', + timeout: 2000 + }) } }