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.
47 lines
1.4 KiB
47 lines
1.4 KiB
//
|
|
// MatchFormatRowView.swift
|
|
// PadelClub
|
|
//
|
|
// Created by Razmig Sarkissian on 02/04/2024.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct MatchFormatRowView: View {
|
|
let matchFormat: MatchFormat
|
|
var headerLabel: String? = nil
|
|
var hideExplanation: Bool = false
|
|
var hideDuration: Bool = false
|
|
var additionalEstimationDuration: Int?
|
|
var displayStyle: DisplayStyle = .wide
|
|
|
|
var body: some View {
|
|
VStack(alignment: .leading) {
|
|
if let headerLabel {
|
|
HStack {
|
|
Text(headerLabel).font(.footnote)
|
|
if hideDuration == false {
|
|
Spacer()
|
|
Text("Durée").font(.footnote)
|
|
}
|
|
}
|
|
}
|
|
HStack {
|
|
Text(matchFormat.formatTitle(displayStyle))
|
|
if hideDuration == false && displayStyle != .short {
|
|
Spacer()
|
|
Text("~" + matchFormat.formattedEstimatedDuration(additionalEstimationDuration ?? 0))
|
|
}
|
|
}
|
|
.font(.headline)
|
|
|
|
if hideExplanation == false {
|
|
Text(matchFormat.longLabel)
|
|
Text(matchFormat.formattedEstimatedBreakDuration() + " de pause").font(.footnote)
|
|
if matchFormat.isFederal == false {
|
|
Text("Non officiel").foregroundStyle(.logoRed).font(.footnote)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|