blob: d0b86bdcfdbed79ffbac3abd4f5147f6e1be9d50 (
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
36
37
38
39
|
import SwiftUI
struct GenericItemView<T: GenericItem>: View {
@EnvironmentObject var settings: SettingsManager
let item: T
let removeAction: (UUID) -> Void
var body: some View {
#if os(macOS)
HStack {
VStack(alignment: .leading) {
Text(item.tags.joined(separator: ", ").lowercased())
Spacer()
Text("On \(item.date.formatted()) from \(item.provider.rawValue)")
.font(.caption)
.foregroundStyle(Color.secondary)
Spacer()
}
}
#else
VStack(alignment: .leading) {
Text(item.tags.joined(separator: ", ").lowercased())
Text("On \(item.date.formatted()) from \(item.provider.rawValue)")
.font(.caption)
.foregroundStyle(Color.secondary)
if let folder = item.folder {
Text("In \(folder.name)")
.font(.caption)
.foregroundStyle(Color.secondary)
}
}
#endif
}
}
|