package com.aiosman.ravenow.ui.points

import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow

object PointsSheetManager {
    private val _visible = MutableStateFlow(false)
    val visible: StateFlow<Boolean> = _visible.asStateFlow()
    var onRecharge: (() -> Unit)? = null

    fun open(onRecharge: (() -> Unit)? = null) {
        this.onRecharge = onRecharge
        _visible.value = true
        PointsViewModel.initLoad()
    }

    fun close() {
        _visible.value = false
        onRecharge = null
    }
}


