package com.gh.gamecenter.search.viewmodel

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.gh.gamecenter.feature.entity.SettingsEntity
import com.gh.gamecenter.login.user.UserManager
import com.gh.gamecenter.login.user.UserRepository
import com.gh.gamecenter.search.SearchTabRepository
import com.halo.assistant.accelerator.repository.AcceleratorDataHolder

class SearchTabActivityViewModel : ViewModel() {

    private val repository = SearchTabRepository.newInstance()

    private val _searchKeyAndType = MutableLiveData<Pair<String?, String>>()
    val searchKeyAndType: LiveData<Pair<String?, String>> = _searchKeyAndType

    fun updateSearchKeyAndType(key: String?, type: String) {
        _searchKeyAndType.value = key to type
    }

    private val _tabs = MutableLiveData<List<SettingsEntity.Search.Navigation>>()
    val tabs: LiveData<List<SettingsEntity.Search.Navigation>> = _tabs

    fun loadTabs() {
        _tabs.value = repository.getSearchTabs()
    }
}