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
|
<script>
import { kebabCase } from 'lodash';
import GroupAvatar from '../avatars/group_avatar.vue';
import InviteAvatar from '../avatars/invite_avatar.vue';
import UserAvatar from '../avatars/user_avatar.vue';
export default {
name: 'MemberAvatar',
components: {
UserAvatar,
InviteAvatar,
GroupAvatar,
AccessRequestAvatar: UserAvatar,
BannedAvatar: UserAvatar,
},
props: {
memberType: {
type: String,
required: true,
},
isCurrentUser: {
type: Boolean,
required: true,
},
member: {
type: Object,
required: true,
},
},
computed: {
avatarComponent() {
// eslint-disable-next-line @gitlab/require-i18n-strings
return `${kebabCase(this.memberType)}-avatar`;
},
},
};
</script>
<template>
<component :is="avatarComponent" :member="member" :is-current-user="isCurrentUser" />
</template>
|