blob: d59eaec2c5bed74a80e37c1ccc61a9b109dac00f [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'" />
Yoshie Muranaka1ace1d92020-02-06 13:47:28 -08004 <icon-warning v-else-if="status === 'warning'" />
Yoshie Muranakadc04feb2019-12-04 08:41:22 -08005 <icon-danger v-else-if="status === 'danger'" />
6 <icon-secondary v-else />
7 </span>
8</template>
9
10<script>
Derick Montaguee2fd1562019-12-20 13:26:53 -060011import IconCheckmark from '@carbon/icons-vue/es/checkmark--filled/20';
12import IconWarning from '@carbon/icons-vue/es/warning--filled/20';
13import IconError from '@carbon/icons-vue/es/error--filled/20';
Yoshie Muranakadc04feb2019-12-04 08:41:22 -080014
15export default {
Derick Montaguee2fd1562019-12-20 13:26:53 -060016 name: 'StatusIcon',
Yoshie Muranakadc04feb2019-12-04 08:41:22 -080017 components: {
18 iconSuccess: IconCheckmark,
Yoshie Muranaka1ace1d92020-02-06 13:47:28 -080019 iconDanger: IconError,
20 iconSecondary: IconError, //TODO: swap with right asset when available
21 iconWarning: IconWarning
Derick Montague09e45cd2020-01-23 15:45:57 -060022 },
23 props: {
24 status: {
25 type: String,
26 default: ''
27 }
Yoshie Muranakadc04feb2019-12-04 08:41:22 -080028 }
29};
30</script>
31
32<style lang="scss" scoped>
33.status-icon {
34 vertical-align: text-bottom;
35 &.success {
36 fill: $success;
37 }
38 &.danger {
39 fill: $danger;
40 }
41 &.secondary {
42 fill: $secondary;
43 }
Yoshie Muranaka1ace1d92020-02-06 13:47:28 -080044 &.warning {
45 fill: $warning;
46 }
Yoshie Muranakadc04feb2019-12-04 08:41:22 -080047}
48</style>