elk/components/status/StatusReplyingTo.vue

41 lines
1.2 KiB
Vue
Raw Normal View History

2022-11-23 01:00:52 +01:00
<script setup lang="ts">
2023-01-08 07:21:09 +01:00
import type { mastodon } from 'masto'
2022-11-23 01:00:52 +01:00
const {
status,
isSelfReply = false,
} = defineProps<{
2023-01-08 07:21:09 +01:00
status: mastodon.v1.Status
isSelfReply: boolean
2022-11-23 01:00:52 +01:00
}>()
2022-12-29 14:11:05 +01:00
const isSelf = $computed(() => status.inReplyToAccountId === status.account.id)
const account = isSelf ? computed(() => status.account) : useAccountById(status.inReplyToAccountId)
2022-11-23 01:00:52 +01:00
</script>
<template>
<NuxtLink
v-if="status.inReplyToId"
flex="~ gap2" items-center h-auto text-sm text-secondary
:to="getStatusInReplyToRoute(status)"
2023-01-09 21:20:26 +01:00
:title="$t('status_replying_to', { username: account ? getDisplayName(account) : $ta('status_replying_to').unknown })"
2023-01-08 10:03:23 +01:00
text-blue saturate-50 hover:saturate-100
>
<template v-if="isSelfReply">
2023-01-08 10:03:23 +01:00
<div i-ri-discuss-line text-blue />
2023-01-09 21:20:26 +01:00
<span>{{ $t('status_show_full_thread') }}</span>
</template>
<template v-else>
2023-01-08 10:03:23 +01:00
<div i-ri-chat-1-line text-blue />
2023-01-09 21:20:26 +01:00
<i18n path="status_replying_to" flex gap-x-1>
<template #username="{ unknown }">
<AccountInlineInfo v-if="account" :account="account" :link="false" />
<template v-else>
{{ unknown }}
</template>
</template>
2023-01-09 21:20:26 +01:00
</i18n>
</template>
</NuxtLink>
2022-11-23 01:00:52 +01:00
</template>