| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- import { Box, Card, Typography } from '@mui/material';
- import Image from 'next/image';
- import PropType from 'prop-types';
-
- const DataCard = ({ data, quantity }) => {
- return (
- <Card
- height="100%"
- sx={{
- backgroundColor: '#f2f2f2',
- mb: 2,
- py: 2,
- mx: { xs: 0, sm: 1 },
- width: { xs: '100%', sm: '44%', md: '30%', lg: '100%' },
- }}
- >
- <Box
- sx={{
- display: 'flex',
- flexDirection: { xs: 'column', lg: 'row' },
- }}
- >
- <Box sx={{ display: 'flex', justifyContent: 'center' }}>
- <Image
- src="/images/coffee-mug.svg"
- alt="profile"
- width={200}
- height={200}
- />
- </Box>
- <Box
- sx={{
- width: '100%',
- display: 'flex',
- flexDirection: 'column',
- alignItems: 'center',
- justifyItems: 'center',
- }}
- >
- <Typography
- sx={{
- textAlign: 'center',
- fontWeight: 600,
- fontSize: { md: 20, xs: 16 },
- pt: { xs: 2 },
- }}
- >
- {data.name}
- </Typography>
- <Typography
- sx={{
- width: '100%',
- textAlign: 'center',
- fontWeight: 600,
- fontSize: { md: 20, xs: 16 },
- }}
- >
- x{quantity}
- </Typography>
- <Typography
- sx={{
- mt: { lg: 3, xs: 1 },
- textAlign: 'center',
- fontSize: 14,
- }}
- >
- ${data.price} (per unit)
- </Typography>
- </Box>
- </Box>
- </Card>
- );
- };
-
- DataCard.propTypes = {
- product: PropType.shape({
- category: PropType.string,
- name: PropType.string,
- image: PropType.string,
- description: PropType.string,
- place: PropType.string,
- people: PropType.string,
- process: PropType.string,
- pairing: PropType.string,
- available: PropType.Boolean,
- isFeatured: PropType.Boolean,
- price: PropType.number,
- customID: PropType.string,
- }),
- quantity: PropType.number,
- };
-
- export default DataCard;
|