<template>
  <el-tag :type="tagType" size="small">{{ label }}</el-tag>
</template>

<script setup>
import { computed } from 'vue'

const props = defineProps({
  status: {
    type: String,
    default: '',
  },
})

const statusMap = {
  playing: { label: '进行中', type: 'success' },
  finished: { label: '已结束', type: 'info' },
  waiting: { label: '等待中', type: 'warning' },
}

const label = computed(() => statusMap[props.status]?.label ?? props.status ?? '-')
const tagType = computed(() => statusMap[props.status]?.type ?? 'info')
</script>
