import SwiftUI
import MoMoUIKits

struct UIKitsInputDemoView: View {
    @State private var text = ""
    @State private var phone = "0987654321"
    @State private var password = "momokits"

    var body: some View {
        DemoScaffold(title: "Input") {
            DemoSection("Text Input") {
                Input(
                    text: $text,
                    placeholder: "Enter text",
                    hintText: "Hint text",
                    onChangeText: { text = $0 }
                )
                Input(
                    text: $phone,
                    placeholder: "Phone number",
                    floatingValue: "Phone",
                    keyboardType: .phonePad,
                    onChangeText: { phone = $0 }
                )
            }

            DemoSection("States") {
                Input(
                    text: $password,
                    placeholder: "Password",
                    secureTextEntry: true,
                    onChangeText: { password = $0 }
                )
                Input(
                    text: .constant("Invalid value"),
                    placeholder: "Error",
                    error: "This field has an error"
                )
                Input(
                    text: .constant("Disabled value"),
                    placeholder: "Disabled",
                    disabled: true
                )
            }
        }
    }
}

