package com.adealink.weparty.profile.search.viewmodel

import androidx.lifecycle.MutableLiveData
import com.adealink.frame.mvvm.livedata.ExtMutableLiveData
import com.adealink.frame.mvvm.viewmodel.BaseViewModel
import kotlinx.coroutines.launch

class SearchViewModel : BaseViewModel() {

    val isInputEmpty = ExtMutableLiveData<Boolean>()

    fun setInput(input: String?) {
        isInputEmpty.send(input.isNullOrEmpty())
    }

    private var keyword: String? = null
    val keywordLD = MutableLiveData<String?>()
    fun search(keyword: String?) {
        this.keyword = keyword
        keywordLD.send(keyword)
    }


    val followChangedLD = ExtMutableLiveData<Pair<String, Boolean>>()

    fun notifyFollowChanged(uid: String, follow: Boolean) {
        followChangedLD.send(Pair(uid, follow))
    }

    val moreUserClickLD = ExtMutableLiveData<Unit>()
    fun clickMoreUser() {
        moreUserClickLD.send(Unit)
    }


    val moreRoomClickLD = ExtMutableLiveData<Unit>()
    fun clickMoreRoom() {
        moreRoomClickLD.send(Unit)
    }
}