package com.gamedog.vididin.di

import com.gamedog.vididin.core.router.interfaces.HomeRouter
import com.gamedog.vididin.core.router.interfaces.LoginRouter
import com.gamedog.vididin.core.router.interfaces.MineRouter
import com.gamedog.vididin.core.router.interfaces.TaskRouter
import com.gamedog.vididin.feature.home.repository.DefaultYoutubeDatasource
import com.gamedog.vididin.feature.home.repository.DefaultYoutubeRepository
import com.gamedog.vididin.main.fragments.home.YoutubeDataSource
import com.gamedog.vididin.main.fragments.home.YoutubeRepository
import com.gamedog.vididin.router.DefaultHomeRouter
import com.gamedog.vididin.router.DefaultLoginRouter
import com.gamedog.vididin.router.DefaultMineRouter
import com.gamedog.vididin.router.DefaultTaskRouter
import dagger.Binds
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton


@Module
@InstallIn(SingletonComponent::class)
object HomeModule {
    @Provides
    @Singleton
    fun providesHomeRouter(): HomeRouter = DefaultHomeRouter()
}

@Module
@InstallIn(SingletonComponent::class)
object TaskModule {
    @Provides
    @Singleton
    fun providesTaskRouter(): TaskRouter = DefaultTaskRouter()
}

@Module
@InstallIn(SingletonComponent::class)
object MineModule {
    @Provides
    @Singleton
    fun providesMineRouter(): MineRouter = DefaultMineRouter()
}


@Module
@InstallIn(SingletonComponent::class)
internal interface YoutubeDataSourceModule {
    @Binds
    fun binds(impl: DefaultYoutubeDatasource): YoutubeDataSource
}


@Module
@InstallIn(SingletonComponent::class)
interface YoutubeRepositoryModule {
    @Binds
    fun bindsYoutubeRepository(repository: DefaultYoutubeRepository): YoutubeRepository
}


@Module
@InstallIn(SingletonComponent::class)
object LoginModule {

    @Provides
    @Singleton
    fun providesLoginRouter(): LoginRouter = DefaultLoginRouter()
}