mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 03:27:52 +00:00
To test this, set the `useNextBubble` value to `true` in the
localstorage. Here's a quick command to run in the console
```js
localStorage.setItem('useNextBubble', true)
```
```js
localStorage.setItem('useNextBubble', false)
```
---------
Co-authored-by: Pranav <pranavrajs@gmail.com>
44 lines
1.2 KiB
Vue
44 lines
1.2 KiB
Vue
<script setup>
|
|
import { computed } from 'vue';
|
|
import BaseBubble from 'next/message/bubbles/Base.vue';
|
|
import FormattedContent from './FormattedContent.vue';
|
|
import AttachmentChips from 'next/message/chips/AttachmentChips.vue';
|
|
import { MESSAGE_TYPES } from '../../constants';
|
|
import { useMessageContext } from '../../provider.js';
|
|
|
|
const { content, attachments, contentAttributes, messageType } =
|
|
useMessageContext();
|
|
|
|
const isTemplate = computed(() => {
|
|
return messageType.value === MESSAGE_TYPES.TEMPLATE;
|
|
});
|
|
|
|
const isEmpty = computed(() => {
|
|
return !content.value && !attachments.value.length;
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<BaseBubble class="flex flex-col gap-3 px-4 py-3" data-bubble-name="text">
|
|
<span v-if="isEmpty" class="text-n-slate-11">
|
|
{{ $t('CONVERSATION.NO_CONTENT') }}
|
|
</span>
|
|
<FormattedContent v-if="content" :content="content" />
|
|
<AttachmentChips :attachments="attachments" class="gap-2" />
|
|
<template v-if="isTemplate">
|
|
<div
|
|
v-if="contentAttributes.submittedEmail"
|
|
class="px-2 py-1 rounded-lg bg-n-alpha-3"
|
|
>
|
|
{{ contentAttributes.submittedEmail }}
|
|
</div>
|
|
</template>
|
|
</BaseBubble>
|
|
</template>
|
|
|
|
<style>
|
|
p:last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
</style>
|