27 lines
696 B
Vue
27 lines
696 B
Vue
<template>
|
|
<UBadge :color="badgeColor" variant="soft" size="xs" class="uppercase tracking-wide font-semibold">
|
|
{{ label }}
|
|
</UBadge>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
const props = defineProps<{ severity: string }>()
|
|
|
|
const LABELS: Record<string, string> = {
|
|
critical: 'Крит',
|
|
high: 'Высок',
|
|
medium: 'Средн',
|
|
low: 'Низк',
|
|
}
|
|
|
|
const COLORS: Record<string, 'red' | 'orange' | 'yellow' | 'green' | 'gray'> = {
|
|
critical: 'red',
|
|
high: 'orange',
|
|
medium: 'yellow',
|
|
low: 'green',
|
|
}
|
|
|
|
const label = computed(() => LABELS[props.severity] ?? props.severity)
|
|
const badgeColor = computed(() => COLORS[props.severity] ?? 'gray')
|
|
</script>
|