-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathActivityKindItem.swift
More file actions
47 lines (39 loc) · 1.13 KB
/
Copy pathActivityKindItem.swift
File metadata and controls
47 lines (39 loc) · 1.13 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
//
// ActivityKindItem.swift
// DevLogPresentation
//
// Created by opfic on 4/4/26.
//
import SwiftUI
import DevLogCore
public struct ActivityKindItem: Identifiable, Hashable {
private let activityKind: ActivityKind
init(from activityKind: ActivityKind) {
self.activityKind = activityKind
}
public static var selectableItems: [ActivityKindItem] {[
.init(from: .created), .init(from: .completed), .init(from: .deleted) ]
}
public var id: String { activityKind.rawValue }
public var rawValue: String { activityKind.rawValue }
public var title: String {
switch activityKind {
case .created:
return String(localized: "profile_activity_created")
case .completed:
return String(localized: "profile_activity_completed")
case .deleted:
return String(localized: "profile_activity_deleted")
}
}
public var badgeColor: Color {
switch activityKind {
case .created:
return .orange
case .completed:
return .blue
case .deleted:
return .red
}
}
}