EmptyScreen.kt 1.4 KB

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