import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import _Radio from "@alifd/next/es/radio";
import * as React from 'react';
import { Component } from 'react';
import "./index.scss";
import "../../components/border-box/index.scss";
var RadioGroup = _Radio.Group;
var BoxStyleSetter = /*#__PURE__*/function (_Component) {
  _inheritsLoose(BoxStyleSetter, _Component);
  function BoxStyleSetter() {
    var _this;
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _Component.call.apply(_Component, [this].concat(args)) || this;
    _this.state = {
      styleType: 2
      // skinType: 'def'
    };
    return _this;
  }
  var _proto = BoxStyleSetter.prototype;
  _proto.render = function render() {
    var _this2 = this,
      _options$;
    var _this$props = this.props,
      options = _this$props.options,
      onChange = _this$props.onChange;
    var onStyleType = function onStyleType(styleType) {
      _this2.setState({
        styleType: styleType
      });
      onChange([styleType, ['none', 'color'][styleType] || "skin1"]);
    };
    var onSkinType = function onSkinType(skinType) {
      // this.setState({
      //     skinType: skinType
      // });
      onChange([2, "skin" + skinType]);
    };
    return /*#__PURE__*/React.createElement("div", {
      className: "box-style-setter"
    }, /*#__PURE__*/React.createElement(RadioGroup, {
      dataSource: options,
      shape: "button",
      value: this.state.styleType,
      onChange: onStyleType
    }), /*#__PURE__*/React.createElement("div", {
      className: "img-select"
    }, this.state.styleType === 2 && ((_options$ = options[2]) === null || _options$ === void 0 ? void 0 : _options$.list.map(function (res, idx) {
      return /*#__PURE__*/React.createElement("div", {
        className: "img-select-li " + (idx === 1000 ? 'active' : '') + " "
      }, /*#__PURE__*/React.createElement("div", {
        className: "border-box " + res.value,
        onClick: function onClick() {
          return onSkinType(idx + 1);
        }
      }, /*#__PURE__*/React.createElement("div", {
        className: "box-title"
      }, /*#__PURE__*/React.createElement("div", {
        className: "box-title-content"
      }, "\u6807\u9898")), /*#__PURE__*/React.createElement("div", {
        className: "box-slot-container"
      })));
    }))));
  };
  return BoxStyleSetter;
}(Component);
BoxStyleSetter.displayName = 'BoxStyleSetter';
export { BoxStyleSetter as default };