//
//  ChangeLoginView.swift
//  AlloVoisinsSwiftUI
//
//  Created by Victor on 23/10/2025.
//

import SwiftUI

enum ChangeLoginType {
    case phone
    case email
}

struct ChangeLoginView: View {
    let type: ChangeLoginType = .phone
    @State var phone: String = ""
    @State var email: String = ""

    var body: some View {
        VStack(spacing: 32) {
            switch type {
            case .email:
                SQTextField("Nouvelle adresse e-mail", text: $email)
                    .sqPlaceholder("Ex : pierredupont@domaine.com")
            case .phone:
                SQPhoneField("Nouveau numéro de téléphone", text: $phone)
                    .sqPlaceholder("Ex : 0600000009")
            }
            SQButton("Confirmer") {}
            Spacer()
        }
        .padding()
    }
}

#Preview {
    ChangeLoginView()
}
