@atlaskit/renderer
Version:
Renderer component
72 lines • 2.63 kB
JavaScript
import _extends from "@babel/runtime/helpers/extends";
import React, { memo } from 'react';
import { Status as AkStatus } from '@atlaskit/status/element';
import { FabricElementsAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
import { fg } from '@atlaskit/platform-feature-flags';
import { useInlineAnnotationProps } from '../../ui/annotations/element/useInlineAnnotationProps';
const ANALYTICS_DATA = {
userContext: 'document'
};
const _default_1 = /*#__PURE__*/memo(function Status(props) {
const {
text,
color,
style,
localId
} = props;
const inlineAnnotationProps = useInlineAnnotationProps(props);
if (fg('platform-dst-lozenge-tag-badge-visual-uplifts')) {
if (fg('editor_inline_comments_on_inline_nodes')) {
return /*#__PURE__*/React.createElement("span", _extends({}, inlineAnnotationProps, {
role: 'emphasis'
}), /*#__PURE__*/React.createElement(FabricElementsAnalyticsContext, {
data: ANALYTICS_DATA
}, /*#__PURE__*/React.createElement(AkStatus, {
text: style === 'mixedCase' ? text : text.toUpperCase(),
color: color,
localId: localId,
role: undefined
})));
}
return /*#__PURE__*/React.createElement(FabricElementsAnalyticsContext, {
data: ANALYTICS_DATA
}, /*#__PURE__*/React.createElement(AkStatus, {
text: style === 'mixedCase' ? text : text.toUpperCase(),
color: color,
localId: localId,
role: undefined
}));
}
if (fg('editor_inline_comments_on_inline_nodes')) {
return /*#__PURE__*/React.createElement("span", _extends({}, inlineAnnotationProps, {
role: 'emphasis'
}), /*#__PURE__*/React.createElement(FabricElementsAnalyticsContext
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
, {
data: {
userContext: 'document'
}
}, /*#__PURE__*/React.createElement(AkStatus, {
text: text,
color: color,
localId: localId,
role: undefined,
isBold: fg('platform-component-visual-refresh')
})));
}
return /*#__PURE__*/React.createElement(FabricElementsAnalyticsContext
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
, {
data: {
userContext: 'document'
}
}, /*#__PURE__*/React.createElement("span", {
role: "emphasis"
}, /*#__PURE__*/React.createElement(AkStatus, {
text: text,
color: color,
localId: localId,
isBold: fg('platform-component-visual-refresh')
})));
});
export default _default_1;