//
//  IdentityValidationNavigationView.swift
//  AlloVoisinsSwiftUI
//
//  Created by Victor on 30/06/2025.
//

import SwiftUI

struct IdentityValidationNavigationView: View {
    @ObservedObject var navigationManager: IdentityValidationNavigationManager
    @ObservedObject var viewModel: IdentityValidationViewModel

    init(navigationManager: IdentityValidationNavigationManager) {
        self.navigationManager = navigationManager
        self.viewModel = .init()
    }

    var body: some View {
        NavigationStack(path: $navigationManager.navigationPath) {
            IdentityInformationsValidationView()
                .navigationDestination(for: IdentityValidationRoute.self) { route in
                    switch route {
                    case .livenessTutorial:
                        LivenessTutorialView()
                    case .liveness:
                        LivenessView()
                    case .livenessSucess:
                        LivenessView()
                    case .livenessError:
                        LivenessView()
                    case .informationsValidation:
                        IdentityInformationsValidationView()
                    case .identityDocumentsList:
                        IdentityInformationsValidationView()
                    case .identityDocumentsValidation:
                        IdentityInformationsValidationView()
                    }
                }
        }
        .environmentObject(navigationManager)
        .environmentObject(viewModel)
    }
}

#Preview {
    IdentityValidationNavigationView(navigationManager: IdentityValidationNavigationManager())
}
