summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/sidebar/components/assignees/sidebar_participant.vue
blob: e2a38a100b968fe9992189598552c85a38889e77 (plain)
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
<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>