package com.zaojiao.app.ui

import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.navigation.compose.composable
import com.zaojiao.app.core.auth.ui.LoginPage
import com.zaojiao.app.core.nav.LJGNavHost
import com.zaojiao.app.core.nav.LJGNavigator
import com.zaojiao.app.feat.home.HomePage

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

    LJGNavHost(
        navHostController = appState.navController,
        startDestination = "/"
    ) {
        composable(route = "/") {
            HomePage()
        }

        composable(route = "/login/sms") {
            LoginPage()
        }
    }
}