import React from 'react';
import PropTypes from 'prop-types';
import Button from '../../Button';

const SlideNext = ({ currentSlide, slideCount, goToSlide, ...props }) => {
  const onSlide = e => {
    e.preventDefault();
    goToSlide(currentSlide + 1);
  };
  return (
    <Button
      onClick={onSlide}
      disabled={currentSlide + 1 === slideCount}
      {...props}
    >
        Next
    </Button>
  );
};

SlideNext.propTypes = {
  currentSlide: PropTypes.number,
  slideCount: PropTypes.number,
  goToSlide: PropTypes.func
};

SlideNext.defaultProps = {
  size: 'lg',
  variant: 'dash-lagoon',
  currentSlide: 0,
  slideCount: 0,
  goToSlide: null
};

export default SlideNext;
