package com.fabledsword.minstrel.update.ui

import androidx.lifecycle.SavedStateHandle
import androidx.lifecycle.ViewModel
import com.fabledsword.minstrel.connectivity.NetworkStatusController
import com.fabledsword.minstrel.update.data.VersionResult
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.StateFlow
import javax.inject.Inject

/**
 * Tiny VM that exposes the [NetworkStatusController]'s current
 * [VersionResult] plus its recheck trigger for the banner button.
 */
@HiltViewModel
class VersionTooOldViewModel @Inject constructor(
    private val controller: NetworkStatusController,
    @Suppress("UnusedPrivateProperty") savedStateHandle: SavedStateHandle,
) : ViewModel() {
    val result: StateFlow<VersionResult> = controller.versionResult
    fun recheck() = controller.recheck()
}
