package com.zaojiao.app.navigation

import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.navigation.compose.NavHost
import com.zaojiao.app.feat.home.navigation.homeCoursePage
import com.zaojiao.app.feat.home.navigation.homeIndex
import com.zaojiao.app.feat.home.navigation.homeIndexPage
import com.zaojiao.app.feat.home.navigation.homePersonalPage
import com.zaojiao.app.ui.AppState

/**
 * Top-level navigation graph. Navigation is organized as explained at
 * https://d.android.com/jetpack/compose/nav-adaptive
 *
 * The navigation graph defined in this file defines the different top level routes. Navigation
 * within each route is handled using state and Back Handlers.
 */
@Composable
fun NavHost(
    appState: AppState,
    modifier: Modifier = Modifier,
    startDestination: String = homeIndex,
) {
    val navController = appState.navController
    NavHost(
        navController = navController,
        startDestination = startDestination,
        modifier = modifier,
    ) {
        homeIndexPage()

        homeCoursePage(
            onBannerClick = {},
            onCourseClick = {},
        )

        homePersonalPage()
    }
}
