20 lines
402 B
TypeScript
20 lines
402 B
TypeScript
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;
|
|
}
|