AlarmGeneralSection.swift 768 B

1234567891011121314151617181920212223242526
  1. // LoopFollow
  2. // AlarmGeneralSection.swift
  3. // Created by Jonas Björkert on 2025-05-12.
  4. import SwiftUI
  5. struct AlarmGeneralSection: View {
  6. @Binding var alarm: Alarm
  7. var body: some View {
  8. Section(
  9. header: Text("General"),
  10. footer: Text("Give each alarm a unique name—especially if you’ve added more than one of the same kind—so you can tell them apart at a glance.")
  11. ) {
  12. HStack {
  13. Text("Name")
  14. TextField("Alarm Name", text: $alarm.name)
  15. .multilineTextAlignment(.trailing)
  16. .textFieldStyle(.plain)
  17. .foregroundColor(.secondary)
  18. }
  19. Toggle("Enabled", isOn: $alarm.isEnabled)
  20. }
  21. }
  22. }