<template>
  <el-tag v-if="config" :type="config.type">
    {{ t(config.label) }}
  </el-tag>
  <span v-else>-</span>
</template>

<script setup lang="ts">
import { computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { getProjectStatusConfig } from '@/enums/projectStatus';

interface Props {
  status: number | undefined;
}

const props = defineProps<Props>();
const { t } = useI18n();

const config = computed(() => {
  if (props.status === undefined || props.status === null) return null;
  return getProjectStatusConfig(props.status);
});
</script>
