"use strict";

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

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

var _sdkCodegen = require("@looker/sdk-codegen");

var _codeEditor = require("@looker/code-editor");

var _reactRedux = require("react-redux");

var _state = require("../../state");

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

var DocCode = _ref => {
  var {
    code,
    language = 'json'
  } = _ref;
  var searchPattern = (0, _reactRedux.useSelector)(_state.selectSearchPattern);
  var gen = (0, _sdkCodegen.findGenerator)(language);
  if (gen) language = gen.language.toLocaleLowerCase();
  return _react.default.createElement(_codeEditor.CodeDisplay, {
    language: language,
    code: code,
    pattern: searchPattern
  });
};

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