import _Input from "@alifd/next/es/input";
import _extends from "@babel/runtime/helpers/extends";
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import _NumberPicker from "@alifd/next/es/number-picker";
import _Rating from "@alifd/next/es/rating";
import _Switch from "@alifd/next/es/switch";
import _TimePicker from "@alifd/next/es/time-picker2";
import _DatePicker from "@alifd/next/es/date-picker2";
import React from 'react';
var context = require.context('../../../components/', true, /^\.\/(?:[^/]+\/){1}index\.tsx$/);
// console.log(context)
var ComponenChild = {};
context.keys().map(function (key) {
  var _context$default;
  if ((_context$default = context(key)["default"]) !== null && _context$default !== void 0 && _context$default.displayName) {
    var _context$default2;
    ComponenChild[(_context$default2 = context(key)["default"]) === null || _context$default2 === void 0 ? void 0 : _context$default2.displayName] = context(key)["default"];
  }
});
ComponenChild['DatePicker'] = _DatePicker;
ComponenChild['TimePicker'] = _TimePicker;
ComponenChild['Switch'] = _Switch;
ComponenChild['Rating'] = _Rating;
ComponenChild['CommonNumberInput'] = _NumberPicker;
var RenderChild = /*#__PURE__*/function (_React$Component) {
  _inheritsLoose(RenderChild, _React$Component);
  function RenderChild(props) {
    var _this;
    _this = _React$Component.call(this, props) || this;
    _this.state = {
      editValue: _this.props.value
    };
    return _this;
  }
  var _proto = RenderChild.prototype;
  _proto.render = function render() {
    var _this$props = this.props,
      props = _this$props.props,
      onChange = _this$props.onChange,
      value = _this$props.value;
    var View = ComponenChild[props.componentType];
    return View ? /*#__PURE__*/React.createElement(View, _extends({}, props, {
      value: value,
      onChange: onChange
    })) : /*#__PURE__*/React.createElement(_Input, props);
  };
  return RenderChild;
}(React.Component);
RenderChild.displayName = 'RenderChild';
export default RenderChild;