'use strict';

exports.__esModule = true;

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

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

var _propTypes2 = _interopRequireDefault(_propTypes);

var _ButtonSort = require('../../atoms/buttons/ButtonSort');

var _ButtonSort2 = _interopRequireDefault(_ButtonSort);

require('./style.css');

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

var SortResults = function SortResults(sortResults) {
  return _react2.default.createElement(
    'div',
    { className: 'ma__sort-results js-sort-results' },
    sortResults.label && _react2.default.createElement(
      'span',
      { className: 'ma__sort-results__label' },
      sortResults.label
    ),
    sortResults.sortButtons.map(function (buttonSort, index) {
      var buttonProps = buttonSort;
      buttonProps.key = 'ButtonSort.' + index;
      return _react2.default.createElement(_ButtonSort2.default, buttonProps);
    })
  );
};

SortResults.propTypes = process.env.NODE_ENV !== "production" ? {
  /** The label text of the sort buttons */
  label: _propTypes2.default.string,
  /** An array of sort button objects */
  sortButtons: _propTypes2.default.arrayOf(_propTypes2.default.shape(_ButtonSort2.default.propTypes)).isRequired
} : {};

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