"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _antd = require("antd");
var _RequiredLabel = _interopRequireDefault(require("../RequiredLabel"));
var _Icon = _interopRequireDefault(require("../Icon"));
var _classnames = _interopRequireDefault(require("classnames"));
require("./index.less");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var _default = function _default(props) {
  var title = props.title,
    options = props.options,
    value = props.value,
    _onChange = props.onChange,
    children = props.children;
  var list = options.map(function (v) {
    return {
      label: /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
        type: v.icon,
        className: (0, _classnames["default"])('tools-select-icon')
      }), " ", v.label),
      value: v.key
    };
  });
  return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_RequiredLabel["default"], {
    label: title,
    type: "field"
  }), /*#__PURE__*/_react["default"].createElement("div", {
    className: (0, _classnames["default"])('tools-select-btn')
  }, /*#__PURE__*/_react["default"].createElement(_antd.Radio.Group, {
    options: list,
    onChange: function onChange(v) {
      return _onChange(v.target.value);
    },
    value: value,
    optionType: "button",
    buttonStyle: "solid"
  }), children));
};
exports["default"] = _default;
//# sourceMappingURL=index.js.map
