diff --git a/app/javascript/dashboard/components-next/message/bubbles/Image.vue b/app/javascript/dashboard/components-next/message/bubbles/Image.vue index 7cdd8106f..67ed53516 100644 --- a/app/javascript/dashboard/components-next/message/bubbles/Image.vue +++ b/app/javascript/dashboard/components-next/message/bubbles/Image.vue @@ -2,6 +2,10 @@ import { ref, computed } from 'vue'; import BaseBubble from './Base.vue'; import Button from 'next/button/Button.vue'; +import Icon from 'next/icon/Icon.vue'; +import { useSnakeCase } from 'dashboard/composables/useTransformKeys'; +import { useMessageContext } from 'next/message/provider.js'; +import GalleryView from 'dashboard/components/widgets/conversation/components/GalleryView.vue'; /** * @typedef {Object} Attachment @@ -36,6 +40,8 @@ const attachment = computed(() => { }); const hasError = ref(false); +const showGallery = ref(false); +const { filteredCurrentChatAttachments } = useMessageContext(); const handleError = () => { hasError.value = true; @@ -57,20 +63,43 @@ const downloadAttachment = async () => { - - + - - + + + {{ $t('COMPONENTS.MEDIA.IMAGE_UNAVAILABLE') }} + + + + + + + + + (showGallery = false)" + /> diff --git a/app/javascript/dashboard/components-next/message/bubbles/Video.vue b/app/javascript/dashboard/components-next/message/bubbles/Video.vue index 40168aee7..2d8586111 100644 --- a/app/javascript/dashboard/components-next/message/bubbles/Video.vue +++ b/app/javascript/dashboard/components-next/message/bubbles/Video.vue @@ -2,6 +2,9 @@ import { ref, computed } from 'vue'; import BaseBubble from './Base.vue'; import Icon from 'next/icon/Icon.vue'; +import { useSnakeCase } from 'dashboard/composables/useTransformKeys'; +import { useMessageContext } from 'next/message/provider.js'; +import GalleryView from 'dashboard/components/widgets/conversation/components/GalleryView.vue'; import { ATTACHMENT_TYPES } from '../constants'; /** @@ -31,6 +34,8 @@ const props = defineProps({ }); const emit = defineEmits(['error']); const hasError = ref(false); +const showGallery = ref(false); +const { filteredCurrentChatAttachments } = useMessageContext(); const handleError = () => { hasError.value = true; @@ -47,7 +52,11 @@ const isReel = computed(() => { - + { @error="handleError" /> + (showGallery = false)" + /> diff --git a/app/javascript/dashboard/components-next/message/chips/Image.vue b/app/javascript/dashboard/components-next/message/chips/Image.vue index 48be0cb31..d14c54539 100644 --- a/app/javascript/dashboard/components-next/message/chips/Image.vue +++ b/app/javascript/dashboard/components-next/message/chips/Image.vue @@ -1,16 +1,52 @@ - + + + {{ $t('COMPONENTS.MEDIA.LOADING_FAILED') }} + + + (showGallery = false)" + /> diff --git a/app/javascript/dashboard/components-next/message/chips/Video.vue b/app/javascript/dashboard/components-next/message/chips/Video.vue index 2d96522a6..c9904b998 100644 --- a/app/javascript/dashboard/components-next/message/chips/Video.vue +++ b/app/javascript/dashboard/components-next/message/chips/Video.vue @@ -1,16 +1,26 @@ + (showGallery = false)" + />
+ {{ $t('COMPONENTS.MEDIA.IMAGE_UNAVAILABLE') }} +