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.
44 lines
1.3 KiB
44 lines
1.3 KiB
//
|
|
// TeamDetailView.swift
|
|
// PadelClub
|
|
//
|
|
// Created by Razmig Sarkissian on 23/03/2024.
|
|
//
|
|
|
|
import SwiftUI
|
|
import LeStorage
|
|
|
|
struct TeamDetailView: View {
|
|
@Environment(Tournament.self) var tournament: Tournament
|
|
@EnvironmentObject var dataStore: DataStore
|
|
var team: TeamRegistration
|
|
|
|
var body: some View {
|
|
if team.unsortedPlayers().isEmpty {
|
|
Text("Aucun joueur, espace réservé")
|
|
} else {
|
|
ForEach(team.players()) { player in
|
|
NavigationLink {
|
|
PlayerDetailView(player: player)
|
|
.environment(tournament)
|
|
} label: {
|
|
VStack(alignment: .leading, spacing: 0) {
|
|
HStack {
|
|
if player.registeredOnline {
|
|
Text("inscrit en ligne")
|
|
}
|
|
Spacer()
|
|
Text(player.localizedSourceLabel())
|
|
}
|
|
.font(.caption).foregroundStyle(.secondary)
|
|
PlayerView(player: player)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
//#Preview {
|
|
// TeamDetailView(team: TeamRegistration.mock())
|
|
//}
|
|
|