package com.syaroful.agrilinkvocpro.plant_disease_detection_feature.navigation

import androidx.compose.runtime.Composable
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import com.syaroful.agrilinkvocpro.plant_disease_detection_feature.presentation.camera.CameraScreen
import com.syaroful.agrilinkvocpro.plant_disease_detection_feature.presentation.camera.CameraViewModel
import com.syaroful.agrilinkvocpro.plant_disease_detection_feature.presentation.detail.DetailScreen
import org.koin.androidx.compose.koinViewModel

@Composable
fun NavGraph(navController: NavHostController) {
    val cameraViewModel: CameraViewModel = koinViewModel()


    NavHost(navController, startDestination = "camera_screen") {
        composable("camera_screen") {
            CameraScreen(navController, cameraViewModel)
        }
        composable("detail_screen"){
            DetailScreen(
                cameraViewModel = cameraViewModel,
                onBack = { navController.popBackStack() }
            )
        }
    }
}