SensorAgeAlarmEditor.swift 1012 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // LoopFollow
  2. // SensorAgeAlarmEditor.swift
  3. // Created by Jonas Björkert on 2025-05-17.
  4. import SwiftUI
  5. struct SensorAgeAlarmEditor: View {
  6. @Binding var alarm: Alarm
  7. var body: some View {
  8. Form {
  9. InfoBanner(
  10. text: "Warn me this many hours before the sensor’s 10-day change-over.",
  11. alarmType: alarm.type
  12. )
  13. AlarmGeneralSection(alarm: $alarm)
  14. AlarmStepperSection(
  15. header: "Early Reminder",
  16. footer: "Number of hours before the 10-day mark that the alert " +
  17. "will fire.",
  18. title: "Reminder Time",
  19. range: 1 ... 24,
  20. step: 1,
  21. unitLabel: "hours",
  22. value: $alarm.threshold
  23. )
  24. AlarmActiveSection(alarm: $alarm)
  25. AlarmAudioSection(alarm: $alarm)
  26. AlarmSnoozeSection(alarm: $alarm)
  27. }
  28. .navigationTitle(alarm.type.rawValue)
  29. }
  30. }