25 lines
627 B
Swift
25 lines
627 B
Swift
import SwiftUI
|
|
|
|
struct SettingsToggleRow: View {
|
|
let title: String
|
|
let subtitle: String?
|
|
@Binding var binding: Bool
|
|
|
|
var body: some View {
|
|
VStack(alignment: .leading, spacing: 6) {
|
|
Toggle(isOn: self.$binding) {
|
|
Text(self.title)
|
|
.font(.body)
|
|
}
|
|
.toggleStyle(.checkbox)
|
|
|
|
if let subtitle, !subtitle.isEmpty {
|
|
Text(subtitle)
|
|
.font(.footnote)
|
|
.foregroundStyle(.tertiary)
|
|
.fixedSize(horizontal: false, vertical: true)
|
|
}
|
|
}
|
|
}
|
|
}
|