import { Button, ButtonGroup, Typography } from '@mui/material';
import { Box } from '@mui/system';
import Image from 'next/image';
import PropType from 'prop-types';

const ProductInfo = ({ bColor, side }) => {
  return (
    <Box
      sx={{
        display: 'flex',
        flexDirection: 'column',
        width: '50%',
        maxWidth: '50%',
        height: '100%',
        pl: side === 'right' ? '10%' : 0,
      }}
    >
      <Typography variant="h3" sx={{ height: 100, mt: 15, color: 'white' }}>
        Frapuccino coffee
      </Typography>
      <Box
        sx={{
          width: 100,
          maxWidth: 100,
          height: 60,
        }}
      >
        <Image
          src="/images/Stars.svg"
          alt="reviews"
          width={100}
          height={50}
        ></Image>
      </Box>
      <Typography
        sx={{
          pr: '20%',
          color: 'white',
        }}
      >
        If you drink coffee regulary you will know the difference between fresh
        coffee and old coffee. Our goal is to provide the freshest coffee beans
        in each day.
      </Typography>
      <Box
        sx={{
          width: '100%',
          display: 'flex',
        }}
      >
        <ButtonGroup
          size="small"
          aria-label="small outlined button group"
          sx={{
            height: 50,
            mr: 3,
            backgroundColor: bColor === 'light' ? '#664c47' : '#8f7772',
            color: 'white',
            border: 0,
          }}
        >
          <Button
            sx={{
              color: 'white',
              fontSize: 20,
              width: 50,
            }}
            onClick={() => {}}
          >
            -
          </Button>
          <Button
            sx={{
              color: 'white',
              fontSize: 17,
              width: 50,
            }}
          >
            1
          </Button>
          <Button
            sx={{
              color: 'white',
              fontSize: 20,
              width: 50,
            }}
            onClick={() => {}}
          >
            +
          </Button>
        </ButtonGroup>
        <Button
          sx={{
            backgroundColor: '#CBA213',
            height: 50,
            width: 150,
            color: 'white',
          }}
        >
          Add to cart
        </Button>
      </Box>
    </Box>
  );
};

ProductInfo.propTypes = {
  bColor: PropType.string,
  side: PropType.string,
};
export default ProductInfo;
