import React, { memo, useMemo } from 'react';
import { getContext, Symbols } from 'choerodon-ui/shared';
import { getPrefixCls } from '../configure/utils';
var AvatarContext = getContext(Symbols.AvatarContext, {
  getPrefixCls: getPrefixCls
});

var BaseAvatarContextProvider = function AvatarContextProvider(props) {
  var children = props.children,
      size = props.size,
      getGlobalPrefixCls = props.getPrefixCls;
  var value = useMemo(function () {
    return {
      size: size,
      getPrefixCls: getGlobalPrefixCls
    };
  }, [getGlobalPrefixCls, size]);
  return /*#__PURE__*/React.createElement(AvatarContext.Provider, {
    value: value
  }, children);
};

BaseAvatarContextProvider.displayName = 'AvatarContextProvider';
export var AvatarContextProvider = /*#__PURE__*/memo(BaseAvatarContextProvider);
export default AvatarContext;
//# sourceMappingURL=AvatarContext.js.map
