feat(shangwutong): render inbound images inline
This commit is contained in:
+10
-3
@@ -4,6 +4,7 @@ import { useMessageContext } from '../../provider.js';
|
||||
|
||||
import MessageFormatter from 'shared/helpers/MessageFormatter.js';
|
||||
import { MESSAGE_VARIANTS } from '../../constants';
|
||||
import { formatShangwutongInlineContent } from '../../inlineMedia.js';
|
||||
|
||||
const props = defineProps({
|
||||
content: {
|
||||
@@ -12,14 +13,20 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
|
||||
const { variant } = useMessageContext();
|
||||
const { variant, attachments, contentAttributes } = useMessageContext();
|
||||
|
||||
const formattedContent = computed(() => {
|
||||
const content = formatShangwutongInlineContent(
|
||||
props.content,
|
||||
attachments.value,
|
||||
contentAttributes.value
|
||||
);
|
||||
|
||||
if (variant.value === MESSAGE_VARIANTS.ACTIVITY) {
|
||||
return props.content;
|
||||
return content;
|
||||
}
|
||||
|
||||
return new MessageFormatter(props.content).formattedMessage;
|
||||
return new MessageFormatter(content).formattedMessage;
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user