package com.example.mystictale.navigation

import android.os.Build
import androidx.annotation.RequiresApi
import androidx.compose.runtime.Composable
import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import com.example.mystictale.Screen.Profile
import com.example.mystictale.Screen.registration.RegistrationDateOfBirth
import com.example.mystictale.Screen.registration.RegistrationEmail
import com.example.mystictale.Screen.registration.RegistrationGender
import com.example.mystictale.Screen.registration.RegistrationName
import com.example.mystictale.Screen.registration.RegistrationPassword
import com.example.mystictale.Screen.Start
import com.example.mystictale.Screen.passwordRecovery.NewPassword
import com.example.mystictale.Screen.passwordRecovery.PasswordRecovery
import com.example.mystictale.Screen.signIn.SignIn
import com.example.mystictale.ViewModels.AuthViewModel

@RequiresApi(Build.VERSION_CODES.O)
@Composable
fun Navigation() {
    val viewModel: AuthViewModel = viewModel()
    val navController = rememberNavController()
    NavHost(navController = navController, startDestination = Screens.Start.route)
    {
        composable(Screens.Start.route)
        {
            Start(navController)
        }
        composable(Screens.RegistrationEmail.route)
        {
            RegistrationEmail(navController,viewModel)
        }
        composable(Screens.RegistrationName.route)
        {
            RegistrationName(navController,viewModel)
        }
        composable(Screens.RegistrationPassword.route)
        {
            RegistrationPassword(navController,viewModel)
        }
        composable(Screens.RegistrationDateOfBirth.route)
        {
            RegistrationDateOfBirth(navController,viewModel)
        }
        composable(Screens.RegistrationGender.route)
        {
            RegistrationGender(navController,viewModel)
        }
        composable(Screens.SingIn.route)
        {
            SignIn(navController,viewModel)
        }
        composable(Screens.PasswordRecovery.route)
        {
            PasswordRecovery(navController,viewModel)
        }
        composable(Screens.NewPassword.route)
        {
            NewPassword(navController,viewModel)
        }
        composable(Screens.Profile.route)
        {
            Profile(navController)
        }

    }
}