2022-11-30 03:47:54 +03:00
|
|
|
<script setup lang="ts">
|
|
|
|
import type { GroupedNotifications } from '~/types'
|
|
|
|
|
|
|
|
const { items } = defineProps<{
|
|
|
|
items: GroupedNotifications
|
|
|
|
}>()
|
|
|
|
|
2024-02-21 18:20:08 +03:00
|
|
|
const count = computed(() => items.items.length)
|
2022-11-30 03:47:54 +03:00
|
|
|
const isExpanded = ref(false)
|
2024-02-21 18:20:08 +03:00
|
|
|
const lang = computed(() => {
|
|
|
|
return (count.value > 1 || count.value === 0) ? undefined : items.items[0].status?.language
|
2022-12-28 00:04:52 +03:00
|
|
|
})
|
2022-11-30 03:47:54 +03:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2023-01-01 17:29:11 +03:00
|
|
|
<article flex flex-col relative :lang="lang ?? undefined">
|
2022-12-06 14:07:17 +03:00
|
|
|
<div flex items-center top-0 left-2 pt-2 px-3>
|
2023-09-08 19:14:19 +03:00
|
|
|
<div :class="count > 1 ? 'i-ri-group-line' : 'i-ri-user-3-line'" me-3 color-blue text-xl aria-hidden="true" />
|
2022-12-14 02:06:53 +03:00
|
|
|
<template v-if="count > 1">
|
2023-01-09 14:24:26 +03:00
|
|
|
<CommonLocalizedNumber
|
|
|
|
keypath="notification.followed_you_count"
|
|
|
|
:count="count"
|
|
|
|
/>
|
2022-12-02 05:18:36 +03:00
|
|
|
</template>
|
2022-12-14 02:06:53 +03:00
|
|
|
<template v-else>
|
2023-01-06 22:12:00 +03:00
|
|
|
<AccountDisplayName
|
|
|
|
:account="items.items[0]?.account"
|
2023-01-01 17:29:11 +03:00
|
|
|
text-primary me-1 font-bold line-clamp-1 ws-pre-wrap break-all
|
2022-12-14 02:06:53 +03:00
|
|
|
/>
|
2023-01-01 17:29:11 +03:00
|
|
|
<span me-1 ws-nowrap>
|
2022-12-14 02:06:53 +03:00
|
|
|
{{ $t('notification.followed_you') }}
|
|
|
|
</span>
|
|
|
|
</template>
|
2022-11-30 03:47:54 +03:00
|
|
|
</div>
|
2023-09-08 19:14:19 +03:00
|
|
|
<div pb-2 ps8>
|
2022-12-06 14:07:17 +03:00
|
|
|
<div v-if="isExpanded">
|
|
|
|
<AccountCard
|
|
|
|
v-for="item in items.items"
|
|
|
|
:key="item.id"
|
|
|
|
:account="item.account"
|
|
|
|
p3
|
|
|
|
/>
|
|
|
|
</div>
|
2022-12-14 02:30:34 +03:00
|
|
|
<div v-else flex="~ wrap gap-1.75" p4>
|
2022-12-06 14:07:17 +03: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 03:47:54 +03:00
|
|
|
</div>
|
|
|
|
</article>
|
|
|
|
</template>
|