2021-11-11 15:05:34 +05:30
|
|
|
<template>
|
2022-06-09 15:40:09 +05:30
|
|
|
<Badge class="text-sm flex-center px-3 ml-2" :color="color" v-if="status">{{
|
2022-04-28 12:04:55 +05:30
|
|
|
statusLabel
|
2021-11-11 15:05:34 +05:30
|
|
|
}}</Badge>
|
|
|
|
</template>
|
|
|
|
<script>
|
2022-06-14 14:40:46 +05:30
|
|
|
import { getStatusMap, statusColor } from 'models/helpers';
|
2022-04-28 12:04:55 +05:30
|
|
|
import Badge from './Badge.vue';
|
2021-11-11 15:05:34 +05:30
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'StatusBadge',
|
|
|
|
props: ['status'],
|
|
|
|
computed: {
|
|
|
|
color() {
|
|
|
|
return statusColor[this.status];
|
|
|
|
},
|
2022-04-28 12:04:55 +05:30
|
|
|
statusLabel() {
|
2022-06-14 14:40:46 +05:30
|
|
|
const statusMap = getStatusMap();
|
|
|
|
return statusMap[this.status] ?? this.status;
|
2022-04-28 12:04:55 +05:30
|
|
|
},
|
2021-11-11 15:05:34 +05:30
|
|
|
},
|
2022-04-28 12:04:55 +05:30
|
|
|
components: { Badge },
|
2021-11-11 15:05:34 +05:30
|
|
|
};
|
|
|
|
</script>
|