2
0
mirror of https://github.com/frappe/books.git synced 2025-02-11 08:28:47 +00:00
books/src/components/Avatar.vue

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
770 B
Vue
Raw Normal View History

<template>
<div class="rounded-full overflow-hidden" :class="sizeClasses">
2019-12-21 21:19:01 +05:30
<img
v-if="imageURL"
:src="imageURL"
class="object-cover"
:class="sizeClasses"
/>
<div
v-else
2022-04-27 17:32:43 +05:30
class="
bg-gray-500
flex
h-full
items-center
justify-center
text-white
w-full
text-base
uppercase
"
>
{{ label && label[0] }}
</div>
</div>
</template>
<script>
export default {
name: 'Avatar',
props: {
imageURL: String,
label: String,
size: {
2022-04-27 17:32:43 +05:30
default: 'md',
},
},
computed: {
sizeClasses() {
return {
sm: 'w-5 h-5',
md: 'w-7 h-7',
2022-04-27 17:32:43 +05:30
lg: 'w-9 h-9',
}[this.size];
2022-04-27 17:32:43 +05:30
},
},
};
</script>