import _Button from "@alifd/next/es/button";
import _Icon from "@alifd/next/es/icon";
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import * as React from 'react';
import { Component } from 'react';
import "./index.scss";
import ShopDialog from "../../components/shopComponents/dialog/index";
var ShopButtonSetter = /*#__PURE__*/function (_Component) {
  _inheritsLoose(ShopButtonSetter, _Component);
  function ShopButtonSetter(props, context) {
    var _this;
    _this = _Component.call(this, props, context) || this;
    _this.state = {
      // theSendData: {},
    };
    return _this;
  }
  var _proto = ShopButtonSetter.prototype;
  _proto.render = function render() {
    var _this$props = this.props,
      btnText = _this$props.btnText,
      icon = _this$props.icon,
      onChange = _this$props.onChange,
      value = _this$props.value;
    var onClose = function onClose() {
      var Obj = {};
      Obj.visible = !value.visible;
      Obj.data = {
        // shopIDarray: this.state.theSendData
      };
      onChange(Obj);
    };
    var theMessageS = function theMessageS(values) {
      // 传递商品的id数组
      // this.setState({
      //   theSendData: values
      // })
      var Obj = {};
      Obj.visible = !value.visible;
      Obj.data = {
        shopIDarray: values
      };
      onChange(Obj);
    };
    return /*#__PURE__*/React.createElement("div", {
      className: "button-setter"
    }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(ShopDialog, {
      visible: value.visible,
      onClose: onClose,
      theMessageS: theMessageS
    })), /*#__PURE__*/React.createElement(_Button, {
      onClick: onClose
    }, /*#__PURE__*/React.createElement(_Icon, {
      type: icon
    }), btnText));
  };
  return ShopButtonSetter;
}(Component);
ShopButtonSetter.displayName = 'ShopButtonSetter';
export { ShopButtonSetter as default };