Files
next-tjwater-drainage-frontend/features/workbench/components/condition-report-risk.ts
T

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;
}