You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
PadelClub/PadelClub/Views/Event/TournamentConfiguratorView....

49 lines
1.3 KiB

//
// TournamentConfiguratorView.swift
// PadelClub
//
// Created by Razmig Sarkissian on 22/03/2024.
//
import SwiftUI
struct TournamentConfigurationView: View {
@Bindable var tournament: Tournament
var minimumTeamsCount: Int {
4
}
var maximumTeamsCount: Int {
128
}
@ViewBuilder
var body: some View {
Picker(selection: $tournament.federalCategory, label: Text("Catégorie")) {
ForEach(TournamentCategory.allCases) { type in
Text(type.localizedLabel()).tag(type.rawValue)
}
}
Picker(selection: $tournament.federalLevelCategory, label: Text("Niveau")) {
ForEach(TournamentLevel.allCases) { type in
Text(type.localizedLabel()).tag(type.rawValue)
}
}
Picker(selection: $tournament.federalAgeCategory, label: Text("Limite d'âge")) {
ForEach(FederalTournamentAge.allCases) { type in
Text(type.localizedLabel()).tag(type.rawValue)
}
}
LabeledContent {
StepperView(count: $tournament.teamCount, minimum: minimumTeamsCount, maximum: maximumTeamsCount)
} label: {
Text("Équipes souhaitées")
Text(tournament.teamCount.formatted())
}
}
}
//
//#Preview {
// TournamentConfiguratorView()
//}