debian-mirror-gitlab/app/assets/javascripts/members/components/table/member_avatar.vue
2021-02-22 17:27:13 +05:30

35 lines
850 B
Vue

<script>
import { kebabCase } from 'lodash';
import UserAvatar from '../avatars/user_avatar.vue';
import InviteAvatar from '../avatars/invite_avatar.vue';
import GroupAvatar from '../avatars/group_avatar.vue';
export default {
name: 'MemberAvatar',
components: { UserAvatar, InviteAvatar, GroupAvatar, AccessRequestAvatar: 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>