//
//  volnahubApp.swift
//  Shared
//
//  Created by cheykrym on 09/06/2025.
//

import SwiftUI

@main
struct volnahubApp: App {
    @StateObject private var themeManager = ThemeManager()
    @StateObject private var viewModel = LoginViewModel()
    
    var body: some Scene {
        WindowGroup {
            Group {
                if viewModel.isLoading {
                    SplashScreenView()
                } else if viewModel.isLoggedIn {
                    MainView(viewModel: viewModel)
                } else {
                    LoginView(viewModel: viewModel)
                }
            }
            .environmentObject(themeManager)
            .preferredColorScheme(themeManager.theme.colorScheme)
        }
    }
}
