UNPKG

@atlaskit/editor-plugin-card

Version:

Card plugin for @atlaskit/editor-core

20 lines 682 B
import React from 'react'; import { RawIntlProvider } from 'react-intl'; import { isSSR, isSSRStreaming } from '@atlaskit/editor-common/core-utils'; import { SmartCardContext } from '@atlaskit/link-provider'; export function SmartCardSSRReactContextsProvider(_ref) { var smartCardContext = _ref.smartCardContext, children = _ref.children, intl = _ref.intl; if (!isSSR() || !isSSRStreaming()) { return children; } if (!intl || !smartCardContext) { return children; } return /*#__PURE__*/React.createElement(RawIntlProvider, { value: intl }, /*#__PURE__*/React.createElement(SmartCardContext.Provider, { value: smartCardContext }, children)); }