package com.example.wabi.domain.supabase

import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import io.github.jan.supabase.SupabaseClient
import io.github.jan.supabase.createSupabaseClient
import io.github.jan.supabase.gotrue.Auth
import io.github.jan.supabase.postgrest.Postgrest
import io.github.jan.supabase.realtime.Realtime
import io.github.jan.supabase.storage.Storage

@Module
@InstallIn(SingletonComponent::class)
class SupabaseServiceProvider {

    @Provides
    fun supabaseClient(): SupabaseClient {
        return createSupabaseClient(
            supabaseUrl = "https://reusjamfhgxymxwkykmb.supabase.co",
            supabaseKey = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InJldXNqYW1maGd4eW14d2t5a21iIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MjkwNTUzMDMsImV4cCI6MjA0NDYzMTMwM30.TiQVqChKE8vs-HLtok_-8BrIy7o4pDEiBuziKcvc1Qc"
        ) {
            install(Auth)
            install(Postgrest)
            install(Realtime)
            install(Storage)
        }
    }
}