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.
37 lines
1.0 KiB
37 lines
1.0 KiB
//
|
|
// TeamWeightView.swift
|
|
// PadelClub
|
|
//
|
|
// Created by Razmig Sarkissian on 18/04/2024.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct TeamWeightView: View {
|
|
var team: TeamRegistration
|
|
var teamPosition: TeamPosition? = nil
|
|
|
|
var body: some View {
|
|
VStack(alignment: .trailing, spacing: 0) {
|
|
if teamPosition == .one || teamPosition == nil {
|
|
Text(team.weight.formatted())
|
|
.monospacedDigit()
|
|
.font(.caption)
|
|
}
|
|
if let teams = team.tournamentObject()?.selectedSortedTeams(), let index = team.index(in: teams) {
|
|
Text("#" + (index + 1).formatted(.number.precision(.integerLength(2...3))))
|
|
.monospacedDigit()
|
|
}
|
|
if teamPosition == .two {
|
|
Text(team.weight.formatted())
|
|
.monospacedDigit()
|
|
.font(.caption)
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
TeamWeightView(team: TeamRegistration.mock(), teamPosition: .one)
|
|
}
|
|
|