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/Tournament/TournamentInitView.swift

62 lines
1.8 KiB

//
// TournamentInitView.swift
// PadelClub
//
// Created by Razmig Sarkissian on 22/03/2024.
//
import SwiftUI
struct TournamentInitView: View {
var tournament: Tournament
@ViewBuilder
var body: some View {
Section {
if let event = tournament.eventObject() {
let tournaments = event.tournaments
NavigationLink(value: Screen.event) {
LabeledContent {
Text(tournaments.count.formatted() + " épreuve" + tournaments.count.pluralSuffix)
} label: {
Text("Gestion de l'événement")
}
}
}
NavigationLink(value: Screen.structure) {
LabeledContent {
Text(tournament.structureDescriptionLocalizedLabel())
} label: {
LabelStructure()
}
}
NavigationLink(value: Screen.settings) {
LabeledContent {
Text(tournament.settingsDescriptionLocalizedLabel())
} label: {
LabelSettings()
}
}
NavigationLink(value: Screen.broadcast) {
LabeledContent {
Image(systemName: tournament.isPrivate ? "tv.slash" : "checkmark")
.foregroundStyle(tournament.isPrivate ? .logoRed : .green)
} label: {
Text("Publication")
}
}
NavigationLink(value: Screen.print) {
Text("Imprimer")
}
}
}
}
#Preview {
TournamentInitView(tournament: Tournament.mock())
}