refactor(workbench): clarify report states
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import type {
|
||||
ScheduledConditionRiskLevel,
|
||||
ScheduledConditionStatus
|
||||
} from "@/features/workbench/types";
|
||||
|
||||
export function getConditionReportRiskLevel(
|
||||
status: ScheduledConditionStatus,
|
||||
riskLevel: ScheduledConditionRiskLevel
|
||||
): ScheduledConditionRiskLevel {
|
||||
if (status === "error") {
|
||||
return "critical";
|
||||
}
|
||||
|
||||
if (status === "warning") {
|
||||
return "attention";
|
||||
}
|
||||
|
||||
return riskLevel;
|
||||
}
|
||||
Reference in New Issue
Block a user