"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Accordion = void 0;

var _react = _interopRequireDefault(require("react"));

var _classnames = _interopRequireDefault(require("classnames"));

var _AccordionItem = require("./AccordionItem");

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

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

var Accordion = function Accordion(_ref) {
  var items = _ref.items,
      _ref$titleHeadingLeve = _ref.titleHeadingLevel,
      titleHeadingLevel = _ref$titleHeadingLeve === void 0 ? 'h2' : _ref$titleHeadingLeve,
      className = _ref.className;
  return /*#__PURE__*/_react.default.createElement("div", {
    className: (0, _classnames.default)('oec-accordion', className),
    "aria-multiselectable": true
  }, items.map(function (item) {
    return /*#__PURE__*/_react.default.createElement(_AccordionItem.AccordionItem, _extends({
      key: item.id
    }, item, {
      headingLevel: titleHeadingLevel
    }));
  }));
};

exports.Accordion = Accordion;