package com.ys.bdtp.adm

import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.runtime.Composable
import androidx.compose.runtime.SideEffect
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import com.google.accompanist.insets.ProvideWindowInsets
import com.google.accompanist.systemuicontroller.rememberSystemUiController
import com.ys.bdtp.adm.app.theme.AdmTheme
import com.ys.bdtp.adm.mvvm.ui.screen.main.Main
import com.ys.bdtp.adm.mvvm.ui.screen.project.Project
import org.kodein.di.compose.onDIContext

@Composable
fun App() = onDIContext(LocalContext.current) {
    val systemUiController = rememberSystemUiController()
    val useDarkIcons = MaterialTheme.colors.isLight

    AdmTheme() {
        ProvideWindowInsets {
            Surface(color = MaterialTheme.colors.background) {
                SideEffect {
                    systemUiController.setNavigationBarColor(
                        color = Color.Transparent,
                        darkIcons = useDarkIcons,
                    )

                    systemUiController.setStatusBarColor(
                        color = Color.Transparent,
                        darkIcons = useDarkIcons,
                    )
                }
                Main()
            }
        }
    }
}
