mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-10-31 02:57:57 +00:00 
			
		
		
		
	 79997fd86f
			
		
	
	79997fd86f
	
	
	
		
			
			Ref: https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap#anywhere Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
		
			
				
	
	
		
			29 lines
		
	
	
		
			655 B
		
	
	
	
		
			Vue
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			655 B
		
	
	
	
		
			Vue
		
	
	
	
	
	
| <script setup>
 | |
| import { computed } from 'vue';
 | |
| import { useMessageContext } from '../../provider.js';
 | |
| 
 | |
| import MessageFormatter from 'shared/helpers/MessageFormatter.js';
 | |
| import { MESSAGE_VARIANTS } from '../../constants';
 | |
| 
 | |
| const props = defineProps({
 | |
|   content: {
 | |
|     type: String,
 | |
|     required: true,
 | |
|   },
 | |
| });
 | |
| 
 | |
| const { variant } = useMessageContext();
 | |
| 
 | |
| const formattedContent = computed(() => {
 | |
|   if (variant.value === MESSAGE_VARIANTS.ACTIVITY) {
 | |
|     return props.content;
 | |
|   }
 | |
| 
 | |
|   return new MessageFormatter(props.content).formattedMessage;
 | |
| });
 | |
| </script>
 | |
| 
 | |
| <template>
 | |
|   <span v-dompurify-html="formattedContent" class="prose prose-bubble" />
 | |
| </template>
 |