"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = exports.RadioContextProvider = void 0;

var _react = _interopRequireWildcard(require("react"));

var _shared = require("choerodon-ui/shared");

var _utils = require("../configure/utils");

var RadioContext = (0, _shared.getContext)(_shared.Symbols.RadioContext, {
  getPrefixCls: _utils.getPrefixCls
});

var BaseRadioContextProvider = function RadioContextProvider(props) {
  var children = props.children,
      radioGroup = props.radioGroup,
      getGlobalPrefixCls = props.getPrefixCls;
  var value = (0, _react.useMemo)(function () {
    return {
      radioGroup: radioGroup,
      getPrefixCls: getGlobalPrefixCls
    };
  }, [getGlobalPrefixCls, radioGroup]);
  return /*#__PURE__*/_react["default"].createElement(RadioContext.Provider, {
    value: value
  }, children);
};

BaseRadioContextProvider.displayName = 'RadioContextProvider';
var RadioContextProvider = /*#__PURE__*/(0, _react.memo)(BaseRadioContextProvider);
exports.RadioContextProvider = RadioContextProvider;
var _default = RadioContext;
exports["default"] = _default;
//# sourceMappingURL=RadioContext.js.map
