"use strict";

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

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

var _runIt = require("@looker/run-it");

var _components = require("../../../components");

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

var DocRequestBody = _ref => {
  var {
    method,
    api
  } = _ref;
  var bodies = method.bodyParams;
  if (bodies.length === 0) return _react.default.createElement(_react.default.Fragment, null);
  var header = bodies.length > 1 ? 'Request bodies' : 'Request body';
  return _react.default.createElement(_runIt.CollapserCard, {
    id: "bodies",
    heading: header
  }, _react.default.createElement(_react.default.Fragment, null, bodies.map(body => _react.default.createElement(_components.ExploreType, {
    api: api,
    type: body.type,
    open: false,
    key: "body.".concat(body.name)
  }))));
};

exports.DocRequestBody = DocRequestBody;
//# sourceMappingURL=DocRequestBody.js.map