debian-mirror-gitlab/app/assets/javascripts/sidebar/components/assignees/sidebar_participant.vue
2021-04-29 21:17:54 +05:30

39 lines
765 B
Vue

<script>
import { GlAvatarLabeled, GlAvatarLink } from '@gitlab/ui';
import { s__, sprintf } from '~/locale';
export default {
components: {
GlAvatarLabeled,
GlAvatarLink,
},
props: {
user: {
type: Object,
required: true,
},
},
computed: {
userLabel() {
if (!this.user.status) {
return this.user.name;
}
return sprintf(s__('UserAvailability|%{author} (Busy)'), {
author: this.user.name,
});
},
},
};
</script>
<template>
<gl-avatar-link>
<gl-avatar-labeled
:size="32"
:label="userLabel"
:sub-label="user.username"
:src="user.avatarUrl || user.avatar || user.avatar_url"
class="gl-align-items-center"
/>
</gl-avatar-link>
</template>