@atlaskit/editor-plugin-card
Version:
Card plugin for @atlaskit/editor-core
21 lines • 620 B
JavaScript
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({
smartCardContext,
children,
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));
}