package com.zaojiao.app.ui

import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import com.zaojiao.app.core.nav.LJGNavHost
import com.zaojiao.app.core.nav.LJGNavigator
import com.zaojiao.app.core.navx.loginRoute
import com.zaojiao.app.feat.baby.babyRoute
import com.zaojiao.app.feat.home.navigation.homePage
import com.zaojiao.app.feat.home.navigation.homeRoute
import com.zaojiao.app.feat.settings.settingRoute

@Composable
fun App(
    appState: AppState = rememberAppState()
) {
    LaunchedEffect(appState) {
        LJGNavigator.handleNavigationCommands(appState.navController)
    }

    LJGNavHost(
        navHostController = appState.navController,
        startDestination = homePage,
    ) {
        homeRoute()
        babyRoute()
        settingRoute()
        loginRoute()
    }
}