diff --git a/app/javascript/dashboard/components-next/message/bubbles/BaseAttachment.vue b/app/javascript/dashboard/components-next/message/bubbles/BaseAttachment.vue new file mode 100644 index 000000000..59cf576bf --- /dev/null +++ b/app/javascript/dashboard/components-next/message/bubbles/BaseAttachment.vue @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + {{ + t(senderTranslationKey, { + sender: senderName, + }) + }} + + + {{ content }} + + + + + + {{ action.label }} + + + {{ action.label }} + + + + diff --git a/app/javascript/dashboard/components-next/message/bubbles/Contact.vue b/app/javascript/dashboard/components-next/message/bubbles/Contact.vue index 83cf69eab..ce16e1b1e 100644 --- a/app/javascript/dashboard/components-next/message/bubbles/Contact.vue +++ b/app/javascript/dashboard/components-next/message/bubbles/Contact.vue @@ -3,8 +3,7 @@ import { computed } from 'vue'; import { useAlert } from 'dashboard/composables'; import { useStore } from 'dashboard/composables/store'; import { useI18n } from 'vue-i18n'; -import BaseBubble from './Base.vue'; -import Icon from 'next/icon/Icon.vue'; +import BaseAttachmentBubble from './BaseAttachment.vue'; import { DuplicateContactException, @@ -52,10 +51,6 @@ const attachment = computed(() => { return props.attachments[0]; }); -const senderName = computed(() => { - return props.sender.name; -}); - const phoneNumber = computed(() => { return attachment.value.fallbackTitle; }); @@ -123,32 +118,20 @@ async function addContact() { } } } + +const action = computed(() => ({ + label: t('CONVERSATION.SAVE_CONTACT'), + onClick: addContact, +})); - - - - - - - - {{ - t('CONVERSATION.SHARED_ATTACHMENT.CONTACT', { - sender: senderName, - }) - }} - - {{ phoneNumber }} - - - - - {{ t('CONVERSATION.SAVE_CONTACT') }} - - - + diff --git a/app/javascript/dashboard/components-next/message/bubbles/File.vue b/app/javascript/dashboard/components-next/message/bubbles/File.vue index 160101d50..c58642f0f 100644 --- a/app/javascript/dashboard/components-next/message/bubbles/File.vue +++ b/app/javascript/dashboard/components-next/message/bubbles/File.vue @@ -2,7 +2,7 @@ import { computed } from 'vue'; import { useI18n } from 'vue-i18n'; -import BaseBubble from './Base.vue'; +import BaseAttachmentBubble from './BaseAttachment.vue'; import FileIcon from 'next/icon/FileIcon.vue'; /** @@ -41,10 +41,6 @@ const url = computed(() => { return props.attachments[0].dataUrl; }); -const senderName = computed(() => { - return props.sender.name; -}); - const fileName = computed(() => { if (url.value) { const filename = url.value.substring(url.value.lastIndexOf('/') + 1); @@ -59,34 +55,19 @@ const fileType = computed(() => { - - - - - - - - {{ - t('CONVERSATION.SHARED_ATTACHMENT.FILE', { - sender: senderName, - }) - }} - - - {{ decodeURI(fileName) }} - - - - - {{ $t('CONVERSATION.DOWNLOAD') }} - - + + + + + diff --git a/app/javascript/dashboard/components-next/message/bubbles/Location.vue b/app/javascript/dashboard/components-next/message/bubbles/Location.vue index f9bec5f37..e6678dcc0 100644 --- a/app/javascript/dashboard/components-next/message/bubbles/Location.vue +++ b/app/javascript/dashboard/components-next/message/bubbles/Location.vue @@ -1,6 +1,6 @@ - - - - - - - - - {{ - t('CONVERSATION.SHARED_ATTACHMENT.LOCATION', { - sender: senderName, - }) - }} - - {{ title }} - - - - - {{ t('COMPONENTS.LOCATION_BUBBLE.SEE_ON_MAP') }} - - - + + + + +