-
-
Notifications
You must be signed in to change notification settings - Fork 424
Expand file tree
/
Copy pathAuthorList.vue
More file actions
47 lines (44 loc) · 1.47 KB
/
AuthorList.vue
File metadata and controls
47 lines (44 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<script setup lang="ts">
import type { ResolvedAuthor } from '#shared/schemas/blog'
defineProps<{
authors: ResolvedAuthor[]
variant?: 'compact' | 'expanded'
}>()
</script>
<template>
<!-- Expanded variant: vertical list with larger avatars -->
<div v-if="variant === 'expanded'" class="flex flex-wrap items-center gap-4">
<div v-for="author in authors" :key="author.name" class="flex items-center gap-2">
<AuthorAvatar :author="author" size="md" disable-link />
<div class="flex flex-col">
<span class="text-sm font-medium text-fg">{{ author.name }}</span>
<a
v-if="author.blueskyHandle && author.profileUrl"
:href="author.profileUrl"
target="_blank"
rel="noopener noreferrer"
:aria-label="$t('blog.author.view_profile', { name: author.name })"
class="text-xs text-fg-muted hover:text-primary transition-colors"
>
@{{ author.blueskyHandle }}
</a>
</div>
</div>
</div>
<!-- Compact variant: no avatars -->
<div v-else class="flex items-center gap-2 min-w-0">
<div class="flex items-center">
<AuthorAvatar
v-for="(author, index) in authors"
:key="author.name"
:author="author"
size="md"
class="ring-2 ring-bg"
:class="index > 0 ? '-ms-3' : ''"
/>
</div>
<span class="text-xs text-fg-muted font-mono truncate">
{{ authors.map(a => a.name).join(', ') }}
</span>
</div>
</template>