Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

DataCard.jsx 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. import { Box, Paper, Typography } from '@mui/material';
  2. import Image from 'next/image';
  3. import PropType from 'prop-types';
  4. const DataCard = ({ data, quantity }) => {
  5. return (
  6. <Paper
  7. sx={{
  8. p: 3,
  9. width: { lg: '100%', xs: '35%' },
  10. mb: 2,
  11. ml: { lg: 0, xs: 6 },
  12. backgroundColor: '#f2f2f2',
  13. display: 'flex',
  14. flex: { xs: [0, 0, '32%'], lg: 'none' },
  15. }}
  16. elevation={3}
  17. >
  18. <Box
  19. sx={{
  20. width: '30%',
  21. borderRadius: 4,
  22. overflow: 'hidden',
  23. display: { xs: 'none', lg: 'block' },
  24. }}
  25. >
  26. <Image
  27. src="/images/coffee-mug.svg"
  28. alt="profile"
  29. width={200}
  30. height={250}
  31. />
  32. </Box>
  33. <Box
  34. sx={{
  35. ml: 3,
  36. display: 'flex',
  37. flexDirection: 'column',
  38. width: { lg: '60%', sx: '100%' },
  39. }}
  40. >
  41. <Typography
  42. sx={{
  43. width: '100%',
  44. textAlign: 'center',
  45. height: 25,
  46. fontWeight: 600,
  47. fontSize: { md: 20, xs: 16 },
  48. }}
  49. >
  50. {data.name} - x{quantity}
  51. </Typography>
  52. <Typography
  53. sx={{
  54. mt: { sm: 3, xs: 6 },
  55. fontSize: 14,
  56. }}
  57. >
  58. {data.description}
  59. </Typography>
  60. <Typography
  61. sx={{
  62. mt: { lg: 3, xs: 1 },
  63. textAlign: 'right',
  64. fontSize: 14,
  65. }}
  66. >
  67. ${data.price} (per unit)
  68. </Typography>
  69. </Box>
  70. </Paper>
  71. );
  72. };
  73. DataCard.propTypes = {
  74. product: PropType.shape({
  75. category: PropType.string,
  76. name: PropType.string,
  77. image: PropType.string,
  78. description: PropType.string,
  79. place: PropType.string,
  80. people: PropType.string,
  81. process: PropType.string,
  82. pairing: PropType.string,
  83. available: PropType.Boolean,
  84. isFeatured: PropType.Boolean,
  85. price: PropType.number,
  86. customID: PropType.string,
  87. }),
  88. quantity: PropType.number,
  89. };
  90. export default DataCard;