//
//  TournamentFormatSelectionView.swift
//  Padel Tournament
//
//  Created by Razmig Sarkissian on 05/10/2023.
//

import SwiftUI

struct TournamentFormatSelectionView: View {
    @Environment(Tournament.self) private var tournament: Tournament

    @ViewBuilder
    var body: some View {
        @Bindable var tournament = tournament

        Section {
            MatchTypeSelectionView(selectedFormat: $tournament.groupStageMatchFormat, format: "Poule")
            MatchTypeSelectionView(selectedFormat: $tournament.matchFormat, format: "Tableau")
            MatchTypeSelectionView(selectedFormat: $tournament.loserBracketMatchFormat, format: "Match de classement")
        } footer: {
            Text("À minima, les règles fédérales seront toujours prises en compte par défaut.")
        }
    }
}
