package com.fastest.pass.home.presentation.viewmodels

import android.util.Log
import androidx.lifecycle.ViewModel
import com.fastest.pass.home.presentation.ui.components.ClickTypeAddNewItem
import com.fastest.pass.home.utils.AddNewItemsRoute
import kotlinx.coroutines.flow.MutableStateFlow

class AddNewItemsViewModel : ViewModel() {
    private val _router = MutableStateFlow<AddNewItemsRoute>(AddNewItemsRoute.OpenNoneScreen)
    val router: MutableStateFlow<AddNewItemsRoute> = _router

    private val _itemScreenName = MutableStateFlow<ClickTypeAddNewItem>(ClickTypeAddNewItem.Password)
    val itemScreenName: MutableStateFlow<ClickTypeAddNewItem> = _itemScreenName

    fun navigateTo(addNewItemsRoute: AddNewItemsRoute) {
        _router.value = addNewItemsRoute
    }

    fun navigateToItemScreen(clickTypeAddNewItem: ClickTypeAddNewItem) {
        Log.d("test_screen_name", "screenName = ${clickTypeAddNewItem.name}")
        _itemScreenName.value = clickTypeAddNewItem
    }
}