package com.omixlab.lckcontrol

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import com.omixlab.lckcontrol.chat.ChatNotificationManager
import com.omixlab.lckcontrol.data.local.TokenStore
import com.omixlab.lckcontrol.data.remote.LckApiService
import com.omixlab.lckcontrol.ui.navigation.AppNavigation
import com.omixlab.lckcontrol.ui.theme.LCKControlTheme
import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject

@AndroidEntryPoint
class MainActivity : ComponentActivity() {

    @Inject lateinit var tokenStore: TokenStore
    @Inject lateinit var apiService: LckApiService
    @Inject lateinit var chatNotificationManager: ChatNotificationManager

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContent {
            LCKControlTheme {
                AppNavigation(tokenStore, apiService)
            }
        }
    }

    override fun onResume() {
        super.onResume()
        chatNotificationManager.setAppForeground(true)
    }

    override fun onPause() {
        super.onPause()
        chatNotificationManager.setAppForeground(false)
    }
}
