import { Box, Button } from '@mui/material';
import PropType from 'prop-types';

const ButtonGroup = ({ handleBackToCart, handleStripePayment }) => {
  return (
    <Box
      sx={{
        display: 'flex',
        ml: 12,
        mb: 2,
        borderRadius: 2,
        p: 1,
      }}
    >
      <Button
        variant="contained"
        sx={{
          mt: 3,
          mb: 2,
          height: 50,
          width: 150,
          textTransform: 'none',
          backgroundColor: 'primary.main',
          color: 'white',
          mr: 2,
        }}
        onClick={handleBackToCart}
      >
        Back to cart
      </Button>
      <Button
        type="submit"
        variant="contained"
        sx={{
          mt: 3,
          mb: 2,
          backgroundColor: '#CBA213',
          height: 50,
          width: 200,
          textTransform: 'none',
          color: 'white',
        }}
        onClick={handleStripePayment}
      >
        Continue to payment
      </Button>
    </Box>
  );
};

ButtonGroup.propTypes = {
  handleBackToCart: PropType.func,
  handleStripePayment: PropType.func,
};

export default ButtonGroup;
