Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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