2022-05-28 01:19:44 -07:00
|
|
|
import Foundation
|
|
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
|
|
struct NodeAnnotation: View {
|
|
|
|
|
let time: Date
|
2023-03-06 10:33:18 -08:00
|
|
|
|
2022-09-05 18:32:27 -07:00
|
|
|
let sixMonthsAgo = Calendar.current.date(byAdding: .month, value: -6, to: Date())
|
2022-05-28 01:19:44 -07:00
|
|
|
|
|
|
|
|
var body: some View {
|
2023-03-06 10:33:18 -08:00
|
|
|
|
|
|
|
|
if time >= sixMonthsAgo! {
|
|
|
|
|
|
2022-09-05 18:32:27 -07:00
|
|
|
VStack(spacing: 0) {
|
|
|
|
|
Text(time, style: .offset)
|
|
|
|
|
.font(.caption2).foregroundColor(.accentColor)
|
|
|
|
|
.padding(5)
|
|
|
|
|
.background(Color(.white))
|
|
|
|
|
.cornerRadius(10)
|
|
|
|
|
}
|
2023-03-06 10:33:18 -08:00
|
|
|
|
2022-09-05 18:32:27 -07:00
|
|
|
} else {
|
2023-03-06 10:33:18 -08:00
|
|
|
|
2022-09-05 18:32:27 -07:00
|
|
|
VStack(spacing: 0) {
|
2022-12-30 09:35:05 -08:00
|
|
|
Text("unknown.age")
|
2022-09-05 18:32:27 -07:00
|
|
|
.font(.caption2).foregroundColor(.accentColor)
|
|
|
|
|
.padding(5)
|
|
|
|
|
.background(Color(.white))
|
|
|
|
|
.cornerRadius(10)
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-05-28 01:19:44 -07:00
|
|
|
|
|
|
|
|
Image(systemName: "mappin.circle.fill")
|
2022-05-30 21:48:46 -07:00
|
|
|
.font(.largeTitle)
|
|
|
|
|
.foregroundColor(.accentColor)
|
2022-05-28 01:19:44 -07:00
|
|
|
|
|
|
|
|
Image(systemName: "arrowtriangle.down.fill")
|
|
|
|
|
.font(.caption)
|
2022-05-30 21:48:46 -07:00
|
|
|
.foregroundColor(.accentColor)
|
2022-05-28 01:19:44 -07:00
|
|
|
.offset(x: 0, y: -5)
|
|
|
|
|
}
|
|
|
|
|
}
|