package com.diegocayo.organizame.presentation.navigation

import androidx.navigation.NavGraphBuilder
import androidx.navigation.NavHostController
import androidx.navigation.compose.composable
import androidx.navigation.navigation
import com.diegocayo.organizame.presentation.features.main.events.create.CreateEventScreen
import com.diegocayo.organizame.presentation.features.main.events.list.EventsListScreen
import com.diegocayo.organizame.presentation.features.main.profile.ProfileScreen
import com.diegocayo.organizame.presentation.features.main.subjects.create.CreateSubjectScreen
import com.diegocayo.organizame.presentation.features.main.subjects.list.SubjectsListScreen
import com.diegocayo.organizame.presentation.features.main.tasks.create.CreateTaskScreen
import com.diegocayo.organizame.presentation.features.main.tasks.list.TasksListScreen

fun NavGraphBuilder.mainNavGraph(navController: NavHostController) {
    navigation(
        startDestination = AppScreen.Main.Tasks.route,
        route = AppScreen.Main.route
    ) {
        composable(route = AppScreen.Main.Tasks.route) {
            TasksListScreen(navController = navController)
        }
        composable(route = AppScreen.Main.Tasks.Create.route) {
            CreateTaskScreen(
                onNavigateBack = { navController.popBackStack() }
            )
        }

        composable(route = AppScreen.Main.Events.route) {
            EventsListScreen(navController = navController)
        }
        composable(route = AppScreen.Main.Events.Create.route) {
            CreateEventScreen(
                onNavigateBack = { navController.popBackStack() }
            )
        }

        // Subjects Navigation
        composable(route = AppScreen.Main.Subjects.route) {
            SubjectsListScreen(navController = navController)
        }
        composable(route = AppScreen.Main.Subjects.Create.route) {
            CreateSubjectScreen(
                onNavigateBack = { navController.popBackStack() }
            )
        }
        
        composable(route = AppScreen.Main.Profile.route) { ProfileScreen(navController) }
    }
}