import React from 'react';
import PropTypes from 'prop-types';
import ButtonSort from '../../atoms/buttons/ButtonSort';

import './style.css';

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

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

export default SortResults;