Download this file
| 1 | import SwiftUI |
| 2 | |
| 3 | /// A labelled call action with a stable target and a visible on/off state. |
| 4 | public struct CallControl: View { |
| 5 | private let title: LocalizedStringKey |
| 6 | private let symbol: String |
| 7 | private let action: () -> Void |
| 8 | |
| 9 | public init(_ title: LocalizedStringKey, systemImage: String, action: @escaping () -> Void) { |
| 10 | self.title = title |
| 11 | self.symbol = systemImage |
| 12 | self.action = action |
| 13 | } |
| 14 | |
| 15 | public var body: some View { |
| 16 | Button(action: action) { |
| 17 | Label(title, systemImage: symbol).frame(minHeight: 32) |
| 18 | }.buttonStyle(.bordered).controlSize(.large) |
| 19 | } |
| 20 | } |
| 21 | |