"use strict";

exports.__esModule = true;
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _iconPreview = _interopRequireDefault(require("../../molecule/icon-preview"));
var _inputText = _interopRequireDefault(require("../../atom/input-text"));
var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
var _provider = _interopRequireWildcard(require("../../atom/provider"));
var _colors = require("../../variables/colors");
var _style = _interopRequireDefault(require("./style.css"));
var _types = _interopRequireDefault(require("./types"));
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const IconEditor = (props, legacyContext) => {
  const translate = (0, _provider.GetTranslateFromContext)(legacyContext);
  const {
    iconPreview,
    inputText,
    buttonLink
  } = props;
  const {
    title,
    icon
  } = iconPreview;
  const inputTextProps = {
    ...inputText,
    type: 'text',
    title: translate('icon_editor_color'),
    placeholder: _colors.COLORS.white,
    theme: 'coorpmanager',
    disabled: false,
    valid: false,
    inputColor: true
  };
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_iconPreview.default, {
    icon: {
      ...icon
    },
    title: title
  }), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.inputButtonContainer
  }, /*#__PURE__*/_react.default.createElement(_inputText.default, inputTextProps), buttonLink ? /*#__PURE__*/_react.default.createElement(_buttonLink.default, buttonLink) : null));
};
IconEditor.contextTypes = {
  translate: _provider.default.childContextTypes.translate
};
IconEditor.propTypes = process.env.NODE_ENV !== "production" ? _types.default : {};
var _default = exports.default = IconEditor;
//# sourceMappingURL=index.js.map