added avatar component

This commit is contained in:
Mamalizz
2025-02-04 23:42:42 +03:30
parent cbb7115b6b
commit 38cd0b1653
+30
View File
@@ -0,0 +1,30 @@
<script setup lang="ts">
// types
type Props = {
src: string;
alt: string;
};
// props
defineProps<Props>();
</script>
<template>
<AvatarRoot
class="bg-black inline-flex size-[45px] select-none items-center justify-center overflow-hidden rounded-full align-middle"
>
<AvatarImage
class="h-full w-full rounded-[inherit] object-cover"
:src="src"
:alt="alt"
/>
<AvatarFallback
class="text-slate-300 leading-1 flex h-full w-full items-center justify-center bg-white text-sm font-medium"
:delay-ms="600"
>
{{ alt }}
</AvatarFallback>
</AvatarRoot>
</template>