package net.hivetechnology.o20010_06.vpn

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

data class VpnUiState(
    val status: String = "idle",
    val deviceName: String = "",
    val detail: String = "",
    val transport: String? = null,
    val latencyMs: Long? = null,
    val active: Boolean = false,
    val errorCode: String? = null,
)

object VpnState {
    private val mutable = MutableStateFlow(VpnUiState())
    val current = mutable.asStateFlow()

    fun update(value: VpnUiState) {
        mutable.value = value
    }
}
