package com.fastest.pass.browse.presentation.viewmodels

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

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

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

    fun navigateTo(browseRoute: BrowseRoute) {
        _router.value = browseRoute
    }

    fun navigateToItemScreen(clickTypeItemBrowse: ClickTypeItemBrowse) {
        Log.d("test_screen_name", "screenNameBrowse = ${clickTypeItemBrowse.name}")
        _itemScreenName.value = clickTypeItemBrowse
    }
}