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/TournamentRunningView.swift

30 lines
974 B

//
// TournamentRunningView.swift
// PadelClub
//
// Created by Razmig Sarkissian on 23/03/2024.
//
import SwiftUI
struct TournamentRunningView: View {
var tournament: Tournament
var allMatches: [Match]
init(tournament: Tournament) {
self.tournament = tournament
self.allMatches = tournament.allMatches()
}
@ViewBuilder
var body: some View {
MatchListView(section: "en cours", matches: tournament.runningMatches(allMatches), hideWhenEmpty: tournament.hasEnded())
// MatchListView(section: "à lancer", matches: tournament.readyMatches(allMatches), isExpanded: false)
// MatchListView(section: "disponible", matches: tournament.availableToStart(allMatches), isExpanded: false)
MatchListView(section: "terminés", matches: tournament.finishedMatches(allMatches), isExpanded: tournament.hasEnded())
}
}
//#Preview {
// TournamentRunningView(tournament: Tournament.mock())
//}