add breakpoints.

This commit is contained in:
2023-01-07 15:29:47 +08:00
parent b9c6b404d3
commit bb70ae2200
13 changed files with 136 additions and 127 deletions

View File

@@ -1,3 +1,5 @@
import { STORAGE_KEY } from "./constants"
export function getACRate(acCount: number, totalCount: number) {
let rate = totalCount === 0 ? 0.0 : ((acCount / totalCount) * 100).toFixed(2)
return `${rate}%`
@@ -12,3 +14,21 @@ export function filterEmptyValue(object: any) {
})
return query
}
export function buildProblemCodeKey(problemID: string, contestID = "") {
if (contestID) {
return `${STORAGE_KEY.PROBLEM_CODE}_${contestID}_${problemID}`
}
return `${STORAGE_KEY.PROBLEM_CODE}_NaN_${problemID}`
}
export function getTagColor(tag: string) {
return {
Low: "success",
Mid: "",
High: "danger",
: "success",
: "",
: "danger",
}[tag]
}