| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- // LoopFollow
- // TemporaryAlarmEditor.swift
- import SwiftUI
- struct TemporaryAlarmEditor: View {
- @Binding var alarm: Alarm
- // Shared BG range
- private let bgRange: ClosedRange<Double> = 40 ... 300
- var body: some View {
- Group {
- InfoBanner(
- text: String(localized: "This alert fires once when glucose crosses either of the limits you set below, and then disables itself."),
- alarmType: alarm.type
- )
- AlarmGeneralSection(alarm: $alarm)
- AlarmBGLimitSection(
- header: String(localized: "Low Limit"),
- footer: String(localized: "Alert if BG is equal to or below this value."),
- toggleText: String(localized: "Enable low limit"),
- pickerTitle: String(localized: "Below"),
- range: bgRange,
- value: $alarm.belowBG
- )
- AlarmBGLimitSection(
- header: String(localized: "High Limit"),
- footer: String(localized: "Alert if BG is equal to or above this value."),
- toggleText: String(localized: "Enable high limit"),
- pickerTitle: String(localized: "Above"),
- range: bgRange,
- value: $alarm.aboveBG
- )
- if alarm.belowBG == nil && alarm.aboveBG == nil {
- Text("⚠️ Please enable at least one limit.")
- .foregroundColor(.red)
- }
- AlarmActiveSection(alarm: $alarm)
- AlarmAudioSection(alarm: $alarm)
- }
- }
- }
|