mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-15 08:31:56 +00:00
42e816081e
Co-authored-by: Alejandro Bailo <59607668+alejandrobailo@users.noreply.github.com>
14 lines
514 B
TypeScript
14 lines
514 B
TypeScript
import { SEVERITY_COLORS } from "./constants";
|
|
|
|
export function getSeverityColorByRiskScore(riskScore: number): string {
|
|
if (riskScore >= 7) return SEVERITY_COLORS.Critical;
|
|
if (riskScore >= 5) return SEVERITY_COLORS.High;
|
|
if (riskScore >= 3) return SEVERITY_COLORS.Medium;
|
|
if (riskScore >= 1) return SEVERITY_COLORS.Low;
|
|
return SEVERITY_COLORS.Informational;
|
|
}
|
|
|
|
export function getSeverityColorByName(name: string): string | undefined {
|
|
return SEVERITY_COLORS[name as keyof typeof SEVERITY_COLORS];
|
|
}
|