2022-11-30 09:47:54 +09:00
|
|
|
<script setup lang="ts">
|
|
|
|
import type { GroupedNotifications } from '~/types'
|
|
|
|
|
|
|
|
const { items } = defineProps<{
|
|
|
|
items: GroupedNotifications
|
|
|
|
}>()
|
|
|
|
|
2022-12-02 11:18:36 +09:00
|
|
|
const { formatHumanReadableNumber, forSR } = useHumanReadableNumber()
|
|
|
|
|
|
|
|
const count = $computed(() => items.items.length)
|
|
|
|
const addSR = $computed(() => forSR(count))
|
2022-11-30 09:47:54 +09:00
|
|
|
const isExpanded = ref(false)
|
2022-12-28 06:04:52 +09:00
|
|
|
const lang = $computed(() => {
|
|
|
|
return count > 1 || count === 0 ? undefined : items.items[0].status?.language
|
|
|
|
})
|
2022-11-30 09:47:54 +09:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2023-01-01 23:29:11 +09:00
|
|
|
<article flex flex-col relative :lang="lang ?? undefined">
|
2022-12-06 20:07:17 +09:00
|
|
|
<div flex items-center top-0 left-2 pt-2 px-3>
|
2023-01-01 23:29:11 +09:00
|
|
|
<div i-ri:user-follow-fill me-3 color-primary aria-hidden="true" />
|
2022-12-14 08:06:53 +09:00
|
|
|
<template v-if="count > 1">
|
|
|
|
<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>
|
2022-12-02 11:18:36 +09:00
|
|
|
{{ $t('notification.followed_you_count', count, { named: { followers: count } }) }}
|
|
|
|
</span>
|
|
|
|
</template>
|
2022-12-14 08:06:53 +09:00
|
|
|
<template v-else>
|
|
|
|
<ContentRich
|
2023-01-01 23:29:11 +09:00
|
|
|
text-primary me-1 font-bold line-clamp-1 ws-pre-wrap break-all
|
2022-12-14 08:06:53 +09:00
|
|
|
:content="getDisplayName(items.items[0]?.account, { rich: true })"
|
|
|
|
:emojis="items.items[0]?.account.emojis"
|
|
|
|
/>
|
2023-01-01 23:29:11 +09:00
|
|
|
<span me-1 ws-nowrap>
|
2022-12-14 08:06:53 +09:00
|
|
|
{{ $t('notification.followed_you') }}
|
|
|
|
</span>
|
|
|
|
</template>
|
2022-11-30 09:47:54 +09:00
|
|
|
</div>
|
2022-12-14 08:06:53 +09:00
|
|
|
<div pb-2>
|
2022-12-06 20:07:17 +09:00
|
|
|
<div v-if="isExpanded">
|
|
|
|
<AccountCard
|
|
|
|
v-for="item in items.items"
|
|
|
|
:key="item.id"
|
|
|
|
:account="item.account"
|
|
|
|
p3
|
|
|
|
/>
|
|
|
|
</div>
|
2022-12-14 08:30:34 +09:00
|
|
|
<div v-else flex="~ wrap gap-1.75" p4>
|
2022-12-06 20:07:17 +09:00
|
|
|
<AccountHoverWrapper
|
|
|
|
v-for="item in items.items"
|
|
|
|
:key="item.id"
|
|
|
|
:account="item.account"
|
|
|
|
>
|
|
|
|
<NuxtLink :to="getAccountRoute(item.account)">
|
|
|
|
<AccountAvatar :account="item.account" w-12 h-12 />
|
|
|
|
</NuxtLink>
|
|
|
|
</AccountHoverWrapper>
|
|
|
|
</div>
|
2022-11-30 09:47:54 +09:00
|
|
|
</div>
|
|
|
|
</article>
|
|
|
|
</template>
|