"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = DocsTabsViewer;

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

var _propTypes = _interopRequireDefault(require("prop-types"));

var _DocsViewerModule = _interopRequireDefault(require("./DocsViewer.module.css"));

var _DocsHeader = _interopRequireDefault(require("./DocsHeader"));

var _DocsTabs = _interopRequireDefault(require("./DocsTabs"));

var _DocsTabsContent = _interopRequireDefault(require("./DocsTabsContent"));

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

function DocsTabsViewer(props) {
  var _props$docConfig = props.docConfig({
    mode: props.mode,
    theme: props.theme
  }, props.components),
      header = _props$docConfig.header,
      tabsList = _props$docConfig.tabsList,
      tabsDetail = _props$docConfig.tabsDetail;

  return /*#__PURE__*/_react["default"].createElement("div", {
    className: _DocsViewerModule["default"].base + " " + _DocsViewerModule["default"][props.colorTheme] + " " + _DocsViewerModule["default"][props.mode]
  }, /*#__PURE__*/_react["default"].createElement(_DocsHeader["default"], {
    title: header.title,
    picUrl: header.imgUrl,
    description: header.description
  }), /*#__PURE__*/_react["default"].createElement("div", {
    className: _DocsViewerModule["default"].tabs_viewer_controller
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: _DocsViewerModule["default"].tabs_viewer
  }, /*#__PURE__*/_react["default"].createElement(_DocsTabs["default"], {
    tabsList: tabsList,
    tabsDetail: tabsDetail
  }), /*#__PURE__*/_react["default"].createElement(_DocsTabsContent["default"], {
    componentType: props.componentType,
    libComponents: props.components,
    tabsList: tabsList,
    tabsDetail: tabsDetail
  }))));
}

DocsTabsViewer.propTypes = {
  docConfig: _propTypes["default"].func,
  componentType: _propTypes["default"].any,
  components: _propTypes["default"].object,
  header: _propTypes["default"].shape({
    title: _propTypes["default"].string,
    imgUrl: _propTypes["default"].string,
    description: _propTypes["default"].string
  }),
  tabsList: _propTypes["default"].arrayOf(_propTypes["default"].string),
  tabsDetail: _propTypes["default"].object,
  mode: _propTypes["default"].string,
  theme: _propTypes["default"].object,
  colorTheme: _propTypes["default"].string
};