1
0
mirror of https://github.com/elk-zone/elk synced 2024-12-12 21:58:05 +09:00
elk/components/account/AccountPostsFollowers.vue

79 lines
2.4 KiB
Vue
Raw Normal View History

2022-11-28 18:51:15 +09:00
<script setup lang="ts">
2023-01-08 15:21:09 +09:00
import type { mastodon } from 'masto'
2022-11-28 18:51:15 +09:00
defineProps<{
2023-01-08 15:21:09 +09:00
account: mastodon.v1.Account
isHoverCard?: boolean
2022-11-28 18:51:15 +09:00
}>()
const userSettings = useUserSettings()
2022-11-28 18:51:15 +09:00
</script>
<template>
<div flex gap-5>
<NuxtLink
:to="getAccountRoute(account)"
replace
text-secondary
exact-active-class="text-primary"
>
2022-11-28 19:14:58 +09:00
<template #default="{ isExactActive }">
<CommonLocalizedNumber
keypath="account.posts_count"
:count="account.statusesCount"
font-bold
:class="isExactActive ? 'text-primary' : 'text-base'"
/>
2022-11-28 19:14:58 +09:00
</template>
2022-11-28 18:51:15 +09:00
</NuxtLink>
<NuxtLink
v-if="!(isHoverCard && getPreferences(userSettings, 'hideFollowerCount'))"
:to="getAccountFollowingRoute(account)"
replace
text-secondary exact-active-class="text-primary"
>
2022-11-28 19:14:58 +09:00
<template #default="{ isExactActive }">
<template
v-if="!getPreferences(userSettings, 'hideFollowerCount')"
>
<CommonLocalizedNumber
v-if="account.followingCount >= 0"
keypath="account.following_count"
:count="account.followingCount"
font-bold
:class="isExactActive ? 'text-primary' : 'text-base'"
/>
<div v-else flex gap-x-1>
<span font-bold text-base>Hidden</span>
<span>{{ $t('account.following') }}</span>
</div>
</template>
<span v-else>{{ $t('account.following') }}</span>
2022-11-28 19:14:58 +09:00
</template>
2022-11-28 18:51:15 +09:00
</NuxtLink>
<NuxtLink
v-if="!(isHoverCard && getPreferences(userSettings, 'hideFollowerCount'))"
:to="getAccountFollowersRoute(account)"
replace text-secondary
exact-active-class="text-primary"
>
2022-11-28 19:14:58 +09:00
<template #default="{ isExactActive }">
<template v-if="!getPreferences(userSettings, 'hideFollowerCount')">
<CommonLocalizedNumber
v-if="account.followersCount >= 0"
keypath="account.followers_count"
:count="account.followersCount"
font-bold
:class="isExactActive ? 'text-primary' : 'text-base'"
/>
<div v-else flex gap-x-1>
<span font-bold text-base>Hidden</span>
<span>{{ $t('account.followers') }}</span>
</div>
</template>
<span v-else>{{ $t('account.followers') }}</span>
2022-11-28 19:14:58 +09:00
</template>
2022-11-28 18:51:15 +09:00
</NuxtLink>
</div>
</template>