import Foundation
import XMPPSwift

enum RegistrationNavigationFlow: Stateable {
    case addNew
    case addExists
}

enum RegistrationServerState: Stateable {
    case idle
    case connecting
    case connected
    case error
}

enum RegistrationClientState: Stateable {
    case idle
    case tryingLogin
    case loggedIn
    case loginError
}

struct RegistrationState: Stateable {
    var navigation: RegistrationNavigationFlow
    var targetJid: JID?
    var serverState: RegistrationServerState
    var clientState: RegistrationClientState
}

// MARK: Init
extension RegistrationState {
    init() {
        navigation = .addNew
        serverState = .idle
        clientState = .idle
    }
}
