| 12345678910111213141516171819202122232425262728293031323334 |
- //
- // StatusPicker.swift
- // Todos
- //
- // Created by Sam Jaffe on 3/7/26.
- //
- import SwiftUI
- struct StatusPicker: View {
- @Binding var status : Status
- var displayIcon : Bool = true
- var body: some View {
- HStack {
- if displayIcon {
- Image(systemName: status.label)
- .frame(width: 20)
- .padding(.trailing, -10)
- }
- Picker("", selection: $status) {
- ForEach(Status.allCases) { unit in
- Text(unit.description).tag(unit)
- }
- }
- .fixedSize(horizontal: true, vertical: false)
- }
- }
- }
- #Preview {
- @Previewable @State var status = Status.todo
- StatusPicker(status: $status, displayIcon: true)
- }
|