'use strict';

exports.__esModule = true;

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

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

var _propTypes2 = _interopRequireDefault(_propTypes);

var _airbnbPropTypes = require('airbnb-prop-types');

require('./style.css');

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

var TableofContents = function TableofContents(props) {
  return _react2.default.createElement(
    'nav',
    { className: 'ma__toc--hierarchy' },
    props.heading,
    _react2.default.createElement(
      'ul',
      { className: 'ma__toc--hierarchy__container' },

      // eslint-disable-next-line react/prop-types
      _react2.default.Children.map(props.children, function (child) {
        return _react2.default.createElement(
          'li',
          null,
          child
        );
      })
    )
  );
};

TableofContents.propTypes = process.env.NODE_ENV !== "production" ? {
  /** The heading text  */
  heading: _propTypes2.default.oneOfType([(0, _airbnbPropTypes.componentWithName)('ColoredHeading'), (0, _airbnbPropTypes.componentWithName)('SidebarHeading')])
} : {};

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