//
//  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))
//        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: false)
    }
}

//#Preview {
//    TournamentRunningView(tournament: Tournament.mock())
//}
