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.
74 lines
2.2 KiB
74 lines
2.2 KiB
//
|
|
// TournamentBuildView.swift
|
|
// PadelClub
|
|
//
|
|
// Created by Razmig Sarkissian on 19/05/2024.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct TournamentBuildView: View {
|
|
var tournament: Tournament
|
|
|
|
@ViewBuilder
|
|
var body: some View {
|
|
Section {
|
|
if tournament.state() != .finished {
|
|
NavigationLink(value: Screen.schedule) {
|
|
let tournamentStatus = tournament.scheduleStatus()
|
|
LabeledContent {
|
|
Text(tournamentStatus.completion)
|
|
} label: {
|
|
Text("Horaires")
|
|
Text(tournamentStatus.label)
|
|
}
|
|
}
|
|
|
|
NavigationLink(value: Screen.call) {
|
|
let tournamentStatus = tournament.callStatus()
|
|
LabeledContent {
|
|
Text(tournamentStatus.completion)
|
|
} label: {
|
|
Text("Convocations")
|
|
Text(tournamentStatus.label)
|
|
}
|
|
}
|
|
}
|
|
NavigationLink(value: Screen.cashier) {
|
|
let tournamentStatus = tournament.cashierStatus()
|
|
LabeledContent {
|
|
Text(tournamentStatus.completion)
|
|
} label: {
|
|
Text("Encaissement")
|
|
Text(tournamentStatus.label)
|
|
}
|
|
}
|
|
}
|
|
|
|
Section {
|
|
if tournament.groupStages().isEmpty == false {
|
|
NavigationLink(value: Screen.groupStage) {
|
|
LabeledContent {
|
|
Text(tournament.groupStageStatus())
|
|
} label: {
|
|
Text("Poules")
|
|
}
|
|
}
|
|
}
|
|
|
|
if tournament.rounds().isEmpty == false {
|
|
NavigationLink(value: Screen.round) {
|
|
LabeledContent {
|
|
Text(tournament.bracketStatus())
|
|
} label: {
|
|
Text("Tableau")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
TournamentBuildView(tournament: Tournament.mock())
|
|
}
|
|
|