//
//  yobbleApp.swift
//  yobble
//
//  Created by cheykrym on 19.09.2025.
//

import SwiftUI

@main
struct yobbleApp: 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)
        }
    }
}
