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.
41 lines
1.1 KiB
41 lines
1.1 KiB
//
|
|
// RoundView.swift
|
|
// PadelClub
|
|
//
|
|
// Created by Razmig Sarkissian on 30/03/2024.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct RoundView: View {
|
|
var round: Round
|
|
|
|
var body: some View {
|
|
List {
|
|
let loserRounds = round.loserRounds()
|
|
if loserRounds.isEmpty == false, let first = loserRounds.first {
|
|
Section {
|
|
NavigationLink {
|
|
LoserRoundsView(upperBracketRound: round)
|
|
.navigationTitle(first.roundTitle())
|
|
} label: {
|
|
Text(first.roundTitle())
|
|
}
|
|
}
|
|
}
|
|
|
|
ForEach(round.matches) { match in
|
|
Section {
|
|
MatchRowView(match: match, matchViewStyle: .sectionedStandardStyle)
|
|
} header: {
|
|
Text(round.roundTitle(.wide) + " " + match.matchTitle(.short))
|
|
}
|
|
}
|
|
}
|
|
.headerProminence(.increased)
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
RoundView(round: Round.mock())
|
|
}
|
|
|