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

54 lines
1.5 KiB
Vue
Raw Normal View History

2022-11-30 00:47:54 +00:00
<script setup lang="ts">
import type { GroupedNotifications } from '~/types'
const { items } = defineProps<{
items: GroupedNotifications
}>()
2022-12-02 02:18:36 +00:00
const { formatHumanReadableNumber, forSR } = useHumanReadableNumber()
const count = $computed(() => items.items.length)
const addSR = $computed(() => forSR(count))
2022-11-30 00:47:54 +00:00
const isExpanded = ref(false)
</script>
<template>
<article flex flex-col>
<div flex ml-4 items-center>
2022-12-02 02:18:36 +00:00
<div i-ri:user-follow-fill mr-3 color-primary aria-hidden="true" />
<template v-if="addSR">
<span
aria-hidden="true"
>
{{ $t('notification.followed_you_count', count, { named: { followers: formatHumanReadableNumber(count) } }) }}
</span>
<span sr-only>
{{ $t('notification.followed_you_count', count, { named: { followers: count } }) }}
</span>
</template>
<span v-else>
{{ $t('notification.followed_you_count', count, { named: { followers: count } }) }}
</span>
2022-11-30 00:47:54 +00:00
</div>
<div v-if="isExpanded">
<AccountCard
v-for="item in items.items"
:key="item.id"
:account="item.account"
p3
/>
</div>
<div v-else flex="~ wrap gap-1" p4>
<AccountHoverWrapper
v-for="item in items.items"
:key="item.id"
:account="item.account"
>
<NuxtLink :to="getAccountRoute(item.account)">
2022-11-30 00:47:54 +00:00
<AccountAvatar :account="item.account" w-8 h-8 />
</NuxtLink>
</AccountHoverWrapper>
</div>
</article>
</template>