"use strict";

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

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

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

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

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

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

var BaseListContextProvider = function ListContextProvider(props) {
  var children = props.children,
      grid = props.grid,
      getGlobalPrefixCls = props.getPrefixCls;
  var value = (0, _react.useMemo)(function () {
    return {
      grid: grid,
      getPrefixCls: getGlobalPrefixCls
    };
  }, [getGlobalPrefixCls, grid]);
  return /*#__PURE__*/_react["default"].createElement(ListContext.Provider, {
    value: value
  }, children);
};

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