AlarmActiveSection.swift 713 B

123456789101112131415161718192021222324
  1. import SwiftUI
  2. struct AlarmActiveSection: View {
  3. @Binding var activeOption: ActiveOption
  4. /// Subset of `ActiveOption` cases the picker is allowed to offer.
  5. /// Defaults to all cases when omitted.
  6. var allowed: [ActiveOption] = ActiveOption.allCases
  7. var body: some View {
  8. Section(
  9. header: Text("Active During"),
  10. footer: Text(
  11. "Day and Night windows are configured globally on the Alarms screen."
  12. )
  13. ) {
  14. AlarmEnumMenuPicker(
  15. title: String(localized: "Active"),
  16. selection: $activeOption,
  17. allowed: allowed
  18. )
  19. }.listRowBackground(Color.chart)
  20. }
  21. }