blob: 102c14bec5bae8c504074cc5f2a4d24f0e1e689b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
//
// SecurityEventSeverity.swift
// octosentry
//
import SwiftUI
nonisolated enum SecurityEventSeverity: Int, Codable, Comparable, CaseIterable, Hashable {
case low
case medium
case high
case critical
static func < (lhs: SecurityEventSeverity, rhs: SecurityEventSeverity) -> Bool {
lhs.rawValue < rhs.rawValue
}
var displayName: String {
switch self {
case .low: "Low"
case .medium: "Medium"
case .high: "High"
case .critical: "Critical"
}
}
var color: Color {
switch self {
case .low: .blue
case .medium: .yellow
case .high: .orange
case .critical: .red
}
}
}
|