debian-mirror-gitlab/app/assets/javascripts/vue_shared/components/project_avatar.vue
2021-09-30 23:02:18 +05:30

45 lines
702 B
Vue

<script>
import { GlAvatar } from '@gitlab/ui';
export default {
components: {
GlAvatar,
},
props: {
projectName: {
type: String,
required: true,
},
projectAvatarUrl: {
type: String,
required: false,
default: '',
},
size: {
type: Number,
default: 32,
required: false,
},
alt: {
type: String,
required: false,
default: undefined,
},
},
computed: {
avatarAlt() {
return this.alt ?? this.projectName;
},
},
};
</script>
<template>
<gl-avatar
shape="rect"
:entity-name="projectName"
:src="projectAvatarUrl"
:alt="avatarAlt"
:size="size"
/>
</template>