feat: implement generic <Avatar> component
This commit is contained in:
parent
f4ddcf9d8d
commit
f98e8c6110
5 changed files with 82 additions and 6 deletions
|
@ -1,8 +1,8 @@
|
|||
<template>
|
||||
<NuxtLink class="user-item" :href="`/me/${user.uuid}`" tabindex="0">
|
||||
<img v-if="props.user.avatar" class="user-avatar" :src="props.user.avatar" :alt="props.user.display_name ?? props.user.username" />
|
||||
<Icon v-else class="user-avatar" name="lucide:user" />
|
||||
<span class="user-display-name">{{ props.user.display_name || props.user.username }}</span>
|
||||
<Avatar :user="props.user" class="user-avatar"/>
|
||||
|
||||
<span class="user-display-name">{{ displayName }}</span>
|
||||
</NuxtLink>
|
||||
</template>
|
||||
|
||||
|
@ -12,6 +12,8 @@ import type { UserResponse } from '~/types/interfaces';
|
|||
const props = defineProps<{
|
||||
user: UserResponse
|
||||
}>();
|
||||
|
||||
const displayName = props.user.display_name || props.user.username
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue