"use strict";

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

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

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

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

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

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

var BaseLayoutSiderContextProvider = function LayoutSiderContextProvider(props) {
  var children = props.children,
      siderCollapsed = props.siderCollapsed,
      collapsedWidth = props.collapsedWidth,
      getGlobalPrefixCls = props.getPrefixCls;
  var value = (0, _react.useMemo)(function () {
    return {
      siderCollapsed: siderCollapsed,
      collapsedWidth: collapsedWidth,
      getPrefixCls: getGlobalPrefixCls
    };
  }, [getGlobalPrefixCls, siderCollapsed, collapsedWidth]);
  return /*#__PURE__*/_react["default"].createElement(LayoutSiderContext.Provider, {
    value: value
  }, children);
};

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