summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/pipelines/components/pipeline_graph/stage_pill.vue
blob: df48426f24e8ad0c53b1a01e6c09de080f36842d (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
<script>
import tooltipOnTruncate from '~/vue_shared/components/tooltip_on_truncate.vue';

export default {
  components: {
    tooltipOnTruncate,
  },
  props: {
    stageName: {
      type: String,
      required: true,
    },
    isEmpty: {
      type: Boolean,
      required: false,
      default: false,
    },
  },
  computed: {
    emptyClass() {
      return this.isEmpty ? 'gl-bg-gray-200' : 'gl-bg-gray-600';
    },
  },
};
</script>
<template>
  <tooltip-on-truncate :title="stageName" truncate-target="child" placement="top">
    <div
      class="gl-px-5 gl-py-2 gl-text-white gl-text-center gl-text-truncate gl-rounded-pill gl-w-20"
      :class="emptyClass"
    >
      {{ stageName }}
    </div>
  </tooltip-on-truncate>
</template>