2021-11-11 15:05:34 +05:30
|
|
|
<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
|
2021-11-11 15:05:34 +05:30
|
|
|
}}</Badge>
|
|
|
|
</template>
|
|
|
|
<script>
|
2022-04-28 12:04:55 +05:30
|
|
|
import { t } from 'fyo';
|
2022-04-21 18:38:36 +05:30
|
|
|
import { statusColor } from 'src/utils/colors';
|
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() {
|
|
|
|
return (
|
|
|
|
{
|
|
|
|
Draft: t`Draft`,
|
|
|
|
Unpaid: t`Unpaid`,
|
|
|
|
Paid: t`Paid`,
|
|
|
|
Cancelled: t`Cancelled`,
|
|
|
|
}[this.status] ?? this.status
|
|
|
|
);
|
|
|
|
},
|
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>
|