// // CallSettingsView.swift // PadelClub // // Created by Razmig Sarkissian on 16/04/2024. // import SwiftUI struct CallSettingsView: View { @EnvironmentObject var dataStore: DataStore @Environment(Tournament.self) var tournament: Tournament var body: some View { List { Section { NavigationLink { } label: { Text("Modifier le message de convocation") } } Section { RowButtonView("Annuler toutes les convocations") { let teams = tournament.unsortedTeams() teams.forEach { team in team.callDate = nil } try? dataStore.teamRegistrations.addOrUpdate(contentOfs: teams) } } Section { RowButtonView("Envoyer un message à tout le monde") { } } Section { RowButtonView("Tout le monde a été convoqué") { let teams = tournament.unsortedTeams() teams.forEach { team in team.callDate = Date() } try? dataStore.teamRegistrations.addOrUpdate(contentOfs: teams) } } } } } #Preview { CallSettingsView() }