2
0
mirror of https://github.com/frappe/books.git synced 2025-02-11 08:28:47 +00:00
books/src/components/StatusBadge.vue

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
531 B
Vue
Raw Normal View History

<template>
<Badge class="text-sm flex-center px-3 ml-2" :color="color" v-if="status">{{
2022-04-28 12:04:55 +05:30
statusLabel
}}</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';
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
},
},
2022-04-28 12:04:55 +05:30
components: { Badge },
};
</script>