package ru.fincode.tsudesk.feature.splash.presentation.navigation

import androidx.navigation.NavGraphBuilder
import androidx.navigation.NavHostController
import androidx.navigation.compose.composable
import ru.fincode.tsudesk.core.navigation.AppRoute
import ru.fincode.tsudesk.feature.splash.presentation.screen.SplashRoute

fun NavGraphBuilder.splashGraph(
    navController: NavHostController
) {
    composable<AppRoute.Splash> {
        SplashRoute(
            onFinish = {
                navController.navigate(AppRoute.Main) {
                    popUpTo(AppRoute.Splash) { inclusive = true }
                    launchSingleTop = true
                }
            }
        )
    }
}
