blob: a2c7f04f8c1a070303afd613f4624b24507f08e9 [file] [log] [blame]
Yoshie Muranakadc04feb2019-12-04 08:41:22 -08001<template>
2 <span :class="['status-icon', status]">
3 <icon-success v-if="status === 'success'" />
4 <icon-danger v-else-if="status === 'danger'" />
5 <icon-secondary v-else />
6 </span>
7</template>
8
9<script>
Derick Montaguee2fd1562019-12-20 13:26:53 -060010import IconCheckmark from '@carbon/icons-vue/es/checkmark--filled/20';
11import IconWarning from '@carbon/icons-vue/es/warning--filled/20';
12import IconError from '@carbon/icons-vue/es/error--filled/20';
Yoshie Muranakadc04feb2019-12-04 08:41:22 -080013
14export default {
Derick Montaguee2fd1562019-12-20 13:26:53 -060015 name: 'StatusIcon',
Yoshie Muranakadc04feb2019-12-04 08:41:22 -080016 components: {
17 iconSuccess: IconCheckmark,
18 iconDanger: IconWarning,
19 iconSecondary: IconError
Derick Montague5e7ac492020-01-23 15:45:57 -060020 },
21 props: {
22 status: {
23 type: String,
24 default: ''
25 }
Yoshie Muranakadc04feb2019-12-04 08:41:22 -080026 }
27};
28</script>
29
30<style lang="scss" scoped>
31.status-icon {
32 vertical-align: text-bottom;
33 &.success {
34 fill: $success;
35 }
36 &.danger {
37 fill: $danger;
38 }
39 &.secondary {
40 fill: $secondary;
41 }
42}
43</style>