Last active
May 12, 2025 10:58
-
-
Save ifucolo/a738be7576e3d8e9529b67f19b3620d8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val prayerState by viewModel.prayersState.collectAsStateWithLifecycle() | |
val context = LocalContext.current | |
Box( | |
modifier = Modifier.fillMaxSize() | |
) { | |
when (prayerState) { | |
PrayerState.Empty -> { | |
EmptyStateScreen( | |
searchQuery = searchQuery, | |
title = context.getString(R.string.empty_screen_title), | |
subtitle = context.getString(R.string.empty_screen_subtitle) | |
) | |
} | |
is PrayerState.Error -> { | |
ErrorStateScreen( | |
onRetry = { prayerState.retryAction() } | |
) | |
} | |
PrayerState.Loading -> { | |
LoadingStateScreen() | |
} | |
is PrayerState.Success -> { | |
is PrayerState.Success -> { | |
PrayersListScreen( | |
prayers = prayerState.prayers, | |
onPrayerClicked = onPrayerClicked, | |
onNovenaClicked = onNovenaClicked, | |
onChapletClicked = onChapletClicked | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment