You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DataCard.jsx 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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: '100%',
  10. mb: 2,
  11. backgroundColor: '#f2f2f2',
  12. display: 'flex',
  13. }}
  14. elevation={3}
  15. >
  16. <Box sx={{ width: '30%', borderRadius: 4, overflow: 'hidden' }}>
  17. <Image
  18. src="/images/coffee-mug.svg"
  19. alt="profile"
  20. width={200}
  21. height={250}
  22. />
  23. </Box>
  24. <Box
  25. sx={{ ml: 3, display: 'flex', flexDirection: 'column', width: '60%' }}
  26. >
  27. <Typography
  28. sx={{
  29. width: '100%',
  30. textAlign: 'center',
  31. height: 25,
  32. fontWeight: 600,
  33. fontSize: 20,
  34. }}
  35. >
  36. {data.name} - x{quantity}
  37. </Typography>
  38. <Typography
  39. sx={{
  40. mt: 3,
  41. fontSize: 14,
  42. }}
  43. >
  44. {data.description}
  45. </Typography>
  46. <Typography
  47. sx={{
  48. mt: 3,
  49. textAlign: 'right',
  50. fontSize: 14,
  51. }}
  52. >
  53. ${data.price} (per unit)
  54. </Typography>
  55. </Box>
  56. </Paper>
  57. );
  58. };
  59. DataCard.propTypes = {
  60. product: PropType.shape({
  61. category: PropType.string,
  62. name: PropType.string,
  63. image: PropType.string,
  64. description: PropType.string,
  65. place: PropType.string,
  66. people: PropType.string,
  67. process: PropType.string,
  68. pairing: PropType.string,
  69. available: PropType.Boolean,
  70. isFeatured: PropType.Boolean,
  71. price: PropType.number,
  72. customID: PropType.string,
  73. }),
  74. quantity: PropType.number,
  75. };
  76. export default DataCard;