// // BarButtonView.swift // PadelClub // // Created by Razmig Sarkissian on 24/04/2024. // import SwiftUI struct BarButtonView: View { let accessibilityLabel: String let icon: String let action: () -> () init(_ accessibilityLabel: String, icon: String, action: @escaping () -> Void) { self.accessibilityLabel = accessibilityLabel self.icon = icon self.action = action } var body: some View { Button(action: { action() }) { if #available(iOS 26.0, *) { Label(accessibilityLabel, systemImage: icon) } else { Image(systemName: icon) .resizable() .scaledToFit() .frame(minHeight: 32) } } } }