package com.example.pmulabs.viewModels

import androidx.compose.runtime.MutableState
import androidx.compose.runtime.State
import androidx.compose.runtime.mutableStateOf
import androidx.lifecycle.ViewModel

class SearchViewModel : ViewModel() {

    private val _searchWidgetState: MutableState<SearchWidget> =
        mutableStateOf(value = SearchWidget.CLOSED)

    val searchWidgetState: State<SearchWidget> = _searchWidgetState

    private val _searchTextState: MutableState<String> =
        mutableStateOf(value = "")

    val searchTextState: State<String> = _searchTextState

    fun updateSearchWidgetState(newValue: SearchWidget) {
        _searchWidgetState.value = newValue
    }

    fun updateSearchTextState(newValue: String) {
        _searchTextState.value = newValue
    }

}