NotLoopingAlarmEditor.swift 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // LoopFollow
  2. // NotLoopingAlarmEditor.swift
  3. // Created by Jonas Björkert on 2025-04-26.
  4. import SwiftUI
  5. struct NotLoopingAlarmEditor: View {
  6. @Binding var alarm: Alarm
  7. var body: some View {
  8. Form {
  9. InfoBanner(
  10. text: "Alerts when no successful loop has occurred for the time "
  11. + "you set below.", alarmType: alarm.type
  12. )
  13. AlarmGeneralSection(alarm: $alarm)
  14. AlarmStepperSection(
  15. header: "No Loop for…",
  16. footer: "Number of minutes since the last successful loop. "
  17. + "When this time has elapsed, the alarm becomes eligible.",
  18. title: "Elapsed time",
  19. range: 16 ... 61,
  20. step: 5,
  21. unitLabel: alarm.type.snoozeTimeUnit.label,
  22. value: Binding(
  23. get: { alarm.threshold ?? 31 },
  24. set: { alarm.threshold = $0 }
  25. )
  26. )
  27. AlarmActiveSection(alarm: $alarm)
  28. AlarmAudioSection(alarm: $alarm)
  29. AlarmSnoozeSection(
  30. alarm: $alarm,
  31. range: 10 ... 120,
  32. step: 5
  33. )
  34. }
  35. .navigationTitle(alarm.type.rawValue)
  36. }
  37. }