FutureCarbsAlarmEditor.swift 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // LoopFollow
  2. // FutureCarbsAlarmEditor.swift
  3. import SwiftUI
  4. struct FutureCarbsAlarmEditor: View {
  5. @Binding var alarm: Alarm
  6. var body: some View {
  7. Group {
  8. InfoBanner(
  9. text: "Alerts when a future-dated carb entry's scheduled time arrives — " +
  10. "a reminder to start eating. Use the max lookahead to ignore " +
  11. "fat/protein entries that are typically scheduled further ahead.",
  12. alarmType: alarm.type
  13. )
  14. AlarmGeneralSection(alarm: $alarm)
  15. AlarmStepperSection(
  16. header: "Max Lookahead",
  17. footer: "Only track carb entries scheduled up to this many minutes " +
  18. "in the future. Entries beyond this window are ignored.",
  19. title: "Lookahead",
  20. range: 5 ... 120,
  21. step: 5,
  22. unitLabel: "min",
  23. value: $alarm.threshold
  24. )
  25. AlarmStepperSection(
  26. header: "Minimum Carbs",
  27. footer: "Ignore carb entries below this amount.",
  28. title: "At or Above",
  29. range: 0 ... 50,
  30. step: 1,
  31. unitLabel: "g",
  32. value: $alarm.delta
  33. )
  34. AlarmActiveSection(alarm: $alarm)
  35. AlarmAudioSection(alarm: $alarm)
  36. AlarmSnoozeSection(alarm: $alarm)
  37. }
  38. }
  39. }