import React from 'react';
import PropTypes from 'prop-types';

import './style.css';

var ButtonSort = function ButtonSort(buttonSort) {
  var buttonSortClass = buttonSort.direction ? ' ma__button-sort--' + buttonSort.direction : '';
  var classNames = 'ma__button-sort js-button-sort' + buttonSortClass;

  return React.createElement(
    'button',
    { type: 'button', className: classNames },
    buttonSort.text
  );
};

ButtonSort.propTypes = process.env.NODE_ENV !== "production" ? {
  /** The label text of the sort button */
  text: PropTypes.string.isRequired,
  /** An array of sort button objects */
  direction: PropTypes.oneOf(['', 'asc', 'dsc'])
} : {};

export default ButtonSort;