@atlaskit/editor-plugin-card
Version:
Card plugin for @atlaskit/editor-core
21 lines • 583 B
JavaScript
import React from 'react';
import { RawIntlProvider } from 'react-intl';
import { isSSR } from '@atlaskit/editor-common/core-utils';
import { SmartCardContext } from '@atlaskit/link-provider';
export function SmartCardSSRReactContextsProvider({
smartCardContext,
children,
intl
}) {
if (!isSSR()) {
return children;
}
if (!intl || !smartCardContext) {
return children;
}
return /*#__PURE__*/React.createElement(RawIntlProvider, {
value: intl
}, /*#__PURE__*/React.createElement(SmartCardContext.Provider, {
value: smartCardContext
}, children));
}