elk/components/content/ContentRich.setup.ts
2023-01-07 10:31:48 +01:00

26 lines
421 B
TypeScript

import type { Emoji } from 'masto'
defineOptions({
name: 'ContentRich',
})
const {
content,
emojis,
markdown = true,
} = defineProps<{
content: string
emojis?: Emoji[]
markdown?: boolean
}>()
const emojisObject = useEmojisFallback(() => emojis)
export default () => h(
'span',
{ class: 'content-rich', dir: 'auto' },
contentToVNode(content, {
emojis: emojisObject.value,
markdown,
}),
)