LiveActivityGlucoseDeltaLabelView.swift 696 B

1234567891011121314151617181920212223242526
  1. //
  2. // LiveActivityGlucoseDeltaLabelView.swift
  3. // FreeAPS
  4. //
  5. // Created by Cengiz Deniz on 17.10.24.
  6. //
  7. import Foundation
  8. import SwiftUI
  9. import WidgetKit
  10. struct LiveActivityGlucoseDeltaLabelView: View {
  11. var context: ActivityViewContext<LiveActivityAttributes>
  12. var glucoseColor: Color
  13. var isDetailed: Bool = false
  14. var body: some View {
  15. if !context.state.change.isEmpty {
  16. Text(context.state.change)
  17. .foregroundStyle(context.state.glucoseColorScheme == "staticColor" ? .primary : glucoseColor)
  18. .strikethrough(context.isStale, pattern: .solid, color: .red.opacity(0.6))
  19. } else {
  20. Text("--")
  21. }
  22. }
  23. }