summaryrefslogtreecommitdiff
path: root/src/components/Global/StatusIcon.vue
blob: d59eaec2c5bed74a80e37c1ccc61a9b109dac00f (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
40
41
42
43
44
45
46
47
48
<template>
  <span :class="['status-icon', status]">
    <icon-success v-if="status === 'success'" />
    <icon-warning v-else-if="status === 'warning'" />
    <icon-danger v-else-if="status === 'danger'" />
    <icon-secondary v-else />
  </span>
</template>

<script>
import IconCheckmark from '@carbon/icons-vue/es/checkmark--filled/20';
import IconWarning from '@carbon/icons-vue/es/warning--filled/20';
import IconError from '@carbon/icons-vue/es/error--filled/20';

export default {
  name: 'StatusIcon',
  components: {
    iconSuccess: IconCheckmark,
    iconDanger: IconError,
    iconSecondary: IconError, //TODO: swap with right asset when available
    iconWarning: IconWarning
  },
  props: {
    status: {
      type: String,
      default: ''
    }
  }
};
</script>

<style lang="scss" scoped>
.status-icon {
  vertical-align: text-bottom;
  &.success {
    fill: $success;
  }
  &.danger {
    fill: $danger;
  }
  &.secondary {
    fill: $secondary;
  }
  &.warning {
    fill: $warning;
  }
}
</style>