'use strict';

exports.__esModule = true;

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

require('./style.css');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

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

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

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

exports.default = ButtonSort;
module.exports = exports['default'];