1
0
Fork 1
mirror of https://github.com/elk-zone/elk.git synced 2024-11-05 00:19:59 +00:00

feat: show translate below content (#185)

This commit is contained in:
Shinigami 2022-11-27 17:54:11 +01:00 committed by GitHub
parent 729b36a606
commit 72d40edbb6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,17 +6,20 @@ const { status, withAction = true } = defineProps<{
withAction?: boolean
}>()
const { translation } = useTranslation(status)
const content = $computed(() => translation.visible ? translation.text : status.content)
</script>
<template>
<div class="status-body" whitespace-pre-wrap break-words :class="{ 'with-action': withAction }">
<ContentRich
v-if="content"
:content="content"
v-if="status.content"
:content="status.content"
:emojis="status.emojis"
/>
<div v-else h-3 />
<template v-if="translation.visible">
<div my2 h-px border="b base" bg-base />
<ContentRich :content="translation.text" :emojis="status.emojis" />
</template>
</div>
</template>