EmptyScreen.kt 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package eu.kanade.presentation.components
  2. import androidx.compose.material.icons.Icons
  3. import androidx.compose.material.icons.automirrored.outlined.HelpOutline
  4. import androidx.compose.material.icons.outlined.HelpOutline
  5. import androidx.compose.material.icons.outlined.Refresh
  6. import androidx.compose.material3.Surface
  7. import androidx.compose.runtime.Composable
  8. import androidx.compose.ui.tooling.preview.PreviewLightDark
  9. import eu.kanade.presentation.theme.TachiyomiTheme
  10. import eu.kanade.tachiyomi.R
  11. import kotlinx.collections.immutable.persistentListOf
  12. import tachiyomi.presentation.core.screens.EmptyScreen
  13. import tachiyomi.presentation.core.screens.EmptyScreenAction
  14. @PreviewLightDark
  15. @Composable
  16. private fun NoActionPreview() {
  17. TachiyomiTheme {
  18. Surface {
  19. EmptyScreen(
  20. textResource = R.string.empty_screen,
  21. )
  22. }
  23. }
  24. }
  25. @PreviewLightDark
  26. @Composable
  27. private fun WithActionPreview() {
  28. TachiyomiTheme {
  29. Surface {
  30. EmptyScreen(
  31. textResource = R.string.empty_screen,
  32. actions = persistentListOf(
  33. EmptyScreenAction(
  34. stringResId = R.string.action_retry,
  35. icon = Icons.Outlined.Refresh,
  36. onClick = {},
  37. ),
  38. EmptyScreenAction(
  39. stringResId = R.string.getting_started_guide,
  40. icon = Icons.AutoMirrored.Outlined.HelpOutline,
  41. onClick = {},
  42. ),
  43. ),
  44. )
  45. }
  46. }
  47. }