UNPKG

@atlaskit/renderer

Version:
70 lines 2.66 kB
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'; var ANALYTICS_DATA = { userContext: 'document' }; var _default_1 = /*#__PURE__*/memo(function Status(props) { var text = props.text, color = props.color, style = props.style, localId = props.localId; var 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;