Sesame-iOS/Sesame-Watch Watch App/Settings/SettingsNumberItemLink.swift
2024-05-25 16:08:51 +02:00

31 lines
761 B
Swift

import SwiftUI
struct SettingsNumberItemLink<Value>: View where Value: FixedWidthInteger {
let title: String
@Binding
var value: Value
let footnote: String
var body: some View {
NavigationLink {
SettingsNumberInputView(
title: title,
value: $value,
footnote: footnote
)
} label: {
SettingsListTextItem(title: title, value: "\(value)")
}
.buttonStyle(PlainButtonStyle())
}
}
struct SettingsNumberItemLink_Previews: PreviewProvider {
static var previews: some View {
SettingsNumberItemLink(title: "Title", value: .constant(0), footnote: "Some more text explaining the purpose of the text field.")
}
}