package __PACKAGE__.presentation.components /** * The four-way lifecycle of a data-backed screen: Loading, Error, Empty, Content. * Sealed so a `when` over it is exhaustive — a screen cannot forget a state, and cannot * render two at once. ViewModels fold repository results into this type; * [ContentStateContainer] renders it. */ sealed interface ContentUiState { data object Loading : ContentUiState data class Error(val message: String) : ContentUiState data object Empty : ContentUiState data class Content(val data: T) : ContentUiState } /** ViewModel-side helper: the Empty/Content decision made once, not per screen. */ fun List.toContentState(): ContentUiState> = if (isEmpty()) ContentUiState.Empty else ContentUiState.Content(this)