import SwiftUI

struct SettingsNumberItemLink: View {

    let title: String

    @Binding
    var value: Int

    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.")
    }
}
