Files
ojnext/src/oj/submission/components/Grade.vue
yuetsh 63e58593d7
Some checks failed
Deploy / deploy (push) Has been cancelled
add flowchart
2025-10-20 20:05:16 +08:00

26 lines
431 B
Vue

<template>
<n-text :type="gradeType(grade)">
<span>{{ score }}</span>
<span>({{ grade }})</span>
</n-text>
</template>
<script setup lang="ts">
import { Grade } from "utils/types"
defineProps<{
score: number
grade: Grade
}>()
function gradeType(grade: Grade) {
return (
{
S: "success",
A: "info",
B: "warning",
C: "error",
} as const
)[grade]
}
</script>
<style scoped></style>