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

var BaseFormContextProvider = function FormContextProvider(props) {
  var children = props.children,
      vertical = props.vertical,
      getGlobalPrefixCls = props.getPrefixCls;
  var value = useMemo(function () {
    return {
      vertical: vertical,
      getPrefixCls: getGlobalPrefixCls
    };
  }, [getGlobalPrefixCls, vertical]);
  return /*#__PURE__*/React.createElement(FormContext.Provider, {
    value: value
  }, children);
};

BaseFormContextProvider.displayName = 'FormContextProvider';
export var FormContextProvider = /*#__PURE__*/memo(BaseFormContextProvider);
export default FormContext;
//# sourceMappingURL=FormContext.js.map
