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

32 lines
640 B
Vue
Raw Normal View History

<template>
<Badge class="text-xs flex-center px-3 ml-2" :color="color" v-if="status">{{
2022-04-28 12:04:55 +05:30
statusLabel
}}</Badge>
</template>
<script>
2022-04-28 12:04:55 +05:30
import { t } from 'fyo';
import { statusColor } from 'src/utils/colors';
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() {
return (
{
Draft: t`Draft`,
Unpaid: t`Unpaid`,
Paid: t`Paid`,
Cancelled: t`Cancelled`,
}[this.status] ?? this.status
);
},
},
2022-04-28 12:04:55 +05:30
components: { Badge },
};
</script>