2
0
mirror of https://github.com/frappe/books.git synced 2025-02-06 05:58:35 +00:00
books/src/components/StatusBadge.vue
2022-06-14 14:40:46 +05:30

25 lines
531 B
Vue

<template>
<Badge class="text-sm flex-center px-3 ml-2" :color="color" v-if="status">{{
statusLabel
}}</Badge>
</template>
<script>
import { getStatusMap, statusColor } from 'models/helpers';
import Badge from './Badge.vue';
export default {
name: 'StatusBadge',
props: ['status'],
computed: {
color() {
return statusColor[this.status];
},
statusLabel() {
const statusMap = getStatusMap();
return statusMap[this.status] ?? this.status;
},
},
components: { Badge },
};
</script>