From 768d8ee8e27ce564110d66132a4c155b942ae6f5 Mon Sep 17 00:00:00 2001 From: josedario87 Date: Wed, 3 Dec 2025 09:37:55 -0600 Subject: [PATCH] UI: Agregar notificaciones toast a todas las funciones de copiar en Mensajes --- app/components/messages/ChatItem.vue | 13 +++++++++++++ app/components/messages/MessageBubble.vue | 13 +++++++++++++ app/pages/messages/index.vue | 13 +++++++++++++ 3 files changed, 39 insertions(+) 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 + }) } }