package com.laseroptek.raman.navigation.graphs

import android.annotation.SuppressLint
import androidx.compose.runtime.Composable
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import com.laseroptek.raman.navigation.Routes
import com.laseroptek.raman.ui.screens.main.MainScreen
import com.laseroptek.raman.ui.screens.main.MainViewModel
import com.laseroptek.raman.ui.screens.splash.SplashView


@SuppressLint("NewApi")
@Composable
fun SplashNavGraph(
    splashNavController: NavHostController = rememberNavController(),
    mainNavController: NavHostController = rememberNavController(),
    mainViewModel: MainViewModel = hiltViewModel<MainViewModel>()
) {
    NavHost(
        navController = splashNavController,
        startDestination = Routes.Splash.route,
    ) {
        composable(
            route = Routes.Splash.route
        ) {
            SplashView(
                splashNavController,
                mainViewModel = mainViewModel
            )
        }

        composable(
            route = Routes.Main.route
        ) {
            MainScreen(
                mainNavController,
                mainViewModel
            )
        }
    }
}
