var _excluded = ["options", "direction", "optionType", "children"];
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
import { Radio as OriginalRadio, Space } from "antd";
import { withWrap } from "../../utils/hoc";
import { useMemo } from "react";
var optionTypeMap = {
  default: OriginalRadio,
  button: OriginalRadio.Button
};
var defaultArr = [];
var Group = function Group(props) {
  var _props$options = props.options,
    options = _props$options === void 0 ? defaultArr : _props$options,
    direction = props.direction,
    optionType = props.optionType,
    children = props.children,
    others = _objectWithoutProperties(props, _excluded);
  var radios = useMemo(function () {
    var RadioCpt = optionTypeMap[optionType || "default"];
    return options.map(function (option) {
      return /*#__PURE__*/React.createElement(RadioCpt, {
        key: option === null || option === void 0 ? void 0 : option.value,
        value: option === null || option === void 0 ? void 0 : option.value,
        disabled: option === null || option === void 0 ? void 0 : option.disabled
      }, option === null || option === void 0 ? void 0 : option.label);
    });
  }, [options]);
  return /*#__PURE__*/React.createElement(OriginalRadio.Group, others, /*#__PURE__*/React.createElement(Space, {
    direction: direction
  }, radios));
};
var Radio = withWrap(OriginalRadio);
Radio.Group = Group;
export default Radio;