package com.example.pmulabs.graphs

import androidx.compose.ui.Modifier
import androidx.navigation.NavGraphBuilder
import androidx.navigation.NavHostController
import androidx.navigation.compose.composable
import androidx.navigation.navigation
import com.example.pmulabs.screensMobile.authScreens.EntryScreen
import com.example.pmulabs.screensMobile.authScreens.RegisterScreen
import com.example.pmulabs.screensMobile.authScreens.SplashScreen
import com.example.pmulabs.viewModels.CurrentUserViewModel
import com.example.pmulabs.viewModels.EntryScreenViewModel
import com.example.pmulabs.viewModels.RegisterScreenViewModel

fun NavGraphBuilder.authNavGraph(navController: NavHostController,registerScreenViewModel: RegisterScreenViewModel,entryScreenViewModel: EntryScreenViewModel, currentUserViewModel: CurrentUserViewModel){
    navigation(
        route=Graph.AUTHENTICATION,
        startDestination = AuthScreen.Splash.route
    ){
        composable(route=AuthScreen.Splash.route){
            SplashScreen(navController = navController, Modifier)
        }
        composable(route=AuthScreen.Entry.route){
            EntryScreen(navController = navController, Modifier,entryScreenViewModel,currentUserViewModel)
        }
        composable(route=AuthScreen.Register.route){
            RegisterScreen(navController = navController, Modifier,registerScreenViewModel,currentUserViewModel)
        }
    }
}

sealed class AuthScreen(val route: String){
    object Splash : AuthScreen(route = "SPLASH")
    object Entry : AuthScreen(route = "ENTRY")
    object Register : AuthScreen(route="REGISTER")
}