{"size": 1256, "ext": "js", "max_stars_repo_path": "src/components/invoices/PreviousNext.js", "max_stars_repo_name": "K-Phaneendra/point_of_sale", "max_stars_repo_stars_event_min_datetime": "2021-05-24T01:38:27.000Z", "max_stars_repo_stars_event_max_datetime": "2021-05-24T01:38:27.000Z", "max_issues_repo_path": "src/components/invoices/PreviousNext.js", "max_issues_repo_name": "K-Phaneendra/point_of_sale", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/components/invoices/PreviousNext.js", "max_forks_repo_name": "K-Phaneendra/point_of_sale", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 21.2881355932, "max_line_length": 66, "alphanum_fraction": 0.5780254777}
import { Button } from '@material-ui/core';
import PropTypes from 'prop-types';

const PreviousNext = ({
  current,
  next,
  nextButtonType,
  totalSteps,
  prev
}) => (
  <div className="steps-action">
    {current > 0 && (
      <Button
        variant="outlined"
        color="primary"
        style={{ margin: '0 8px' }}
        onClick={prev}
      >
        Previous
      </Button>
    )}
    {current < totalSteps - 1 && nextButtonType !== 'submit' && (
      <Button color="primary" variant="contained" onClick={next}>
        Next
      </Button>
    )}
    {current < totalSteps - 1 && nextButtonType === 'submit' && (
      <Button color="primary" variant="contained" type="submit">
        Next
      </Button>
    )}
    {current === totalSteps - 1 && (
      <Button
        color="primary"
        variant="contained"
        // onClick={() => message.success('Processing complete!')}
      >
        Done
      </Button>
    )}
  </div>
);

PreviousNext.propTypes = {
  current: PropTypes.number,
  next: PropTypes.func,
  nextButtonType: PropTypes.string,
  totalSteps: PropTypes.number,
  prev: PropTypes.func
};

PreviousNext.defaultProps = {
  current: 0,
  totalSteps: 4,
  nextButtonType: 'button'
};

export default PreviousNext;
