"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.AccordionTabs = void 0;
var _react = _interopRequireDefault(require("react"));
var _classnames = _interopRequireDefault(require("classnames"));
var _accordionTab = require("./accordion-tab");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/** Tabs component to be positioned bellow expanded accordion row */
const AccordionTabs = ({
  tabs,
  selectedTabKey,
  className,
  testId,
  isSeparatePageTab = false,
  onSelect,
  onSelectSubOptions = () => {},
  NavLink
}) => {
  if (!tabs || !tabs.length) {
    return null;
  }
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
    className: (0, _classnames.default)('accordion-tabs', className, isSeparatePageTab && 'separate-page-tabs'),
    "test-id": testId,
    children: tabs.map((tab, i) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_accordionTab.AccordionTab, {
      tab: tab,
      index: i,
      selectedTabKey: selectedTabKey,
      onSelect: (selectedTab, index) => onSelect?.(selectedTab, index),
      onSelectSubOptions: onSelectSubOptions,
      NavLink: NavLink
    }, tab.key))
  });
};
exports.AccordionTabs = AccordionTabs;