package id.iiyh.inatrading.feature.explore.presentation

import androidx.lifecycle.ViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import id.iiyh.inatrading.feature.explore.data.model.LocationItem
import javax.inject.Inject
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow

@HiltViewModel
class ExploreNavViewModel @Inject constructor() : ViewModel() {

    private val _selectedLocation = MutableStateFlow<LocationItem?>(null)
    val selectedLocation: StateFlow<LocationItem?> = _selectedLocation.asStateFlow()

    fun select(location: LocationItem) {
        _selectedLocation.value = location
    }
}
