feat: show translate below content (#185)

zio/stable
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
1 changed files with 6 additions and 3 deletions

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>