"use strict";

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

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

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

var _components = require("@looker/components");

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

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

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

var SdkLanguageSelector = () => {
  var {
    setSdkLanguageAction
  } = (0, _state.useSettingActions)();
  var selectedSdkLanguage = (0, _reactRedux.useSelector)(_state.selectSdkLanguage);

  var allSdkLanguages = _sdkCodegen.codeGenerators.map(gen => ({
    value: gen.language
  }));

  allSdkLanguages.push({
    options: [{
      value: 'All'
    }]
  });

  var handleChange = language => {
    setSdkLanguageAction({
      sdkLanguage: language
    });
  };

  return _react.default.createElement(_components.Select, {
    "aria-label": "sdk language selector",
    value: selectedSdkLanguage,
    onChange: handleChange,
    options: allSdkLanguages
  });
};

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