2022-11-23 00:42:20 +01:00
|
|
|
import type { Emoji } from 'masto'
|
|
|
|
import type { PropType } from 'vue'
|
|
|
|
import { emojisArrayToObject } from '~/composables/utils'
|
|
|
|
|
2022-11-20 22:21:53 +01:00
|
|
|
export default defineComponent({
|
|
|
|
props: {
|
|
|
|
content: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
2022-11-23 00:42:20 +01:00
|
|
|
emojis: {
|
|
|
|
type: Array as PropType<Emoji[]>,
|
|
|
|
},
|
2022-11-20 22:21:53 +01:00
|
|
|
},
|
|
|
|
setup(props) {
|
2022-11-23 00:42:20 +01:00
|
|
|
const emojiObject = emojisArrayToObject(props.emojis || [])
|
|
|
|
|
2022-11-23 00:08:36 +01:00
|
|
|
return () => h(
|
|
|
|
'div',
|
|
|
|
{ class: 'rich-content' },
|
2022-11-24 04:42:03 +01:00
|
|
|
contentToVNode(props.content, emojiObject),
|
2022-11-23 00:08:36 +01:00
|
|
|
)
|
2022-11-20 22:21:53 +01:00
|
|
|
},
|
|
|
|
})
|