"use strict";

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

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

var _propTypes = _interopRequireDefault(require("prop-types"));

var Controls = _interopRequireWildcard(require("./controls/index"));

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }

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

var DynamicComponent = function DynamicComponent(props) {
  var map = props.map;
  var CustomComponent = Controls.default[map];
  return _react.default.createElement(CustomComponent, props);
};

exports.DynamicComponent = DynamicComponent;
DynamicComponent.propTypes = process.env.NODE_ENV !== "production" ? {
  map: _propTypes.default.string.isRequired
} : {};
var _default = DynamicComponent;
exports.default = _default;