package com.example.wabi.domain.navigation

import androidx.navigation.NavHostController
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Inject

@Module
@InstallIn(SingletonComponent::class)
class NavigationProvider @Inject constructor() {
    @Provides
    fun goToNextScreen(
        navHostController: NavHostController,
        whereFrom: String,
        where: String
    ): Boolean {
        navHostController.popBackStack()
        navHostController.navigate(where) {
            popUpTo(whereFrom) {
                inclusive = true
            }
        }

        return true
    }
}