36 lines
959 B
Swift
36 lines
959 B
Swift
|
|
import SwiftUI
|
||
|
|
|
||
|
|
struct ToggleRow: View {
|
||
|
|
let icon: String
|
||
|
|
let title: String
|
||
|
|
var subtitle: String? = nil
|
||
|
|
@Binding var isOn: Bool
|
||
|
|
|
||
|
|
var body: some View {
|
||
|
|
HStack(spacing: 12) {
|
||
|
|
Image(systemName: icon)
|
||
|
|
.font(.system(size: 16, weight: .medium))
|
||
|
|
.foregroundColor(AppTheme.blue)
|
||
|
|
.frame(width: 24)
|
||
|
|
|
||
|
|
VStack(alignment: .leading, spacing: 2) {
|
||
|
|
Text(title)
|
||
|
|
.font(AppTheme.bodyFont)
|
||
|
|
.foregroundColor(AppTheme.textPrimary)
|
||
|
|
if let subtitle {
|
||
|
|
Text(subtitle)
|
||
|
|
.font(AppTheme.captionFont)
|
||
|
|
.foregroundColor(AppTheme.textSecondary)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
Spacer()
|
||
|
|
|
||
|
|
Toggle("", isOn: $isOn)
|
||
|
|
.labelsHidden()
|
||
|
|
.tint(AppTheme.blue)
|
||
|
|
}
|
||
|
|
.padding(.vertical, 4)
|
||
|
|
}
|
||
|
|
}
|