36 lines
820 B
Vue
36 lines
820 B
Vue
<script setup lang="ts">
|
|
import { type Variants, Badge } from '~/components/pub/ui/badge'
|
|
import { dataStatusCodes } from '~/lib/constants';
|
|
|
|
const props = defineProps<{
|
|
rec: any
|
|
idx?: number
|
|
}>()
|
|
|
|
const statusCodeColors: Record<string, Variants> = {
|
|
new: 'warning',
|
|
review: 'fresh',
|
|
process: 'fresh',
|
|
done: 'positive',
|
|
canceled: 'destructive',
|
|
rejected: 'destructive',
|
|
skiped: 'negative',
|
|
}
|
|
|
|
const statusText = computed(() => {
|
|
return dataStatusCodes[props.rec.status_code as keyof typeof dataStatusCodes]
|
|
})
|
|
|
|
const badgeVariant = computed(() => {
|
|
return (statusCodeColors[props.rec.status_code as keyof typeof statusCodeColors] || 'default')
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<div class="flex justify-center">
|
|
<Badge :variant="badgeVariant">
|
|
{{ statusText }}
|
|
</Badge>
|
|
</div>
|
|
</template>
|