import React from 'react';
import { findGenerator } from '@looker/sdk-codegen';
import { CodeDisplay } from '@looker/code-editor';
import { useSelector } from 'react-redux';
import { selectSearchPattern } from '../../state';
export var DocCode = _ref => {
  var {
    code,
    language = 'json'
  } = _ref;
  var searchPattern = useSelector(selectSearchPattern);
  var gen = findGenerator(language);
  if (gen) language = gen.language.toLocaleLowerCase();
  return React.createElement(CodeDisplay, {
    language: language,
    code: code,
    pattern: searchPattern
  });
};
//# sourceMappingURL=DocCode.js.map