ClassicCard.kt 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright (c) Milan Jurkulák 2024.
  3. * Contact:
  4. * e: mimoccc@gmail.com
  5. * e: mj@mjdev.org
  6. * w: https://mjdev.org
  7. */
  8. package eu.mjdev.desktop.components.card
  9. import androidx.compose.foundation.interaction.MutableInteractionSource
  10. import androidx.compose.foundation.layout.*
  11. import androidx.compose.runtime.Composable
  12. import androidx.compose.ui.Modifier
  13. import eu.mjdev.desktop.components.card.base.*
  14. @Suppress("unused")
  15. @Composable
  16. fun ClassicCard(
  17. onClick: () -> Unit,
  18. image: @Composable BoxScope.() -> Unit,
  19. title: @Composable () -> Unit,
  20. modifier: Modifier = Modifier,
  21. onLongClick: (() -> Unit)? = null,
  22. subtitle: @Composable () -> Unit = {},
  23. description: @Composable () -> Unit = {},
  24. shape: CardShape = CardDefaults.shape(),
  25. colors: CardColors = CardDefaults.colors(),
  26. scale: CardScale = CardDefaults.scale(),
  27. border: CardBorder = CardDefaults.border(),
  28. glow: CardGlow = CardDefaults.glow(),
  29. contentPadding: PaddingValues = PaddingValues(),
  30. interactionSource: MutableInteractionSource? = null
  31. ) = Card(
  32. onClick = onClick,
  33. onLongClick = onLongClick,
  34. modifier = modifier,
  35. interactionSource = interactionSource,
  36. shape = shape,
  37. colors = colors,
  38. scale = scale,
  39. border = border,
  40. glow = glow
  41. ) {
  42. Column(modifier = Modifier.padding(contentPadding)) {
  43. Box(contentAlignment = CardDefaults.ContentImageAlignment, content = image)
  44. Column { CardContent(title = title, subtitle = subtitle, description = description) }
  45. }
  46. }