diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field.tsx index 423c40effa996..2660b577d956a 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field.tsx @@ -13,6 +13,7 @@ import { isEmpty, isNumber } from 'lodash/fp'; import React from 'react'; import { css } from '@emotion/css'; import type { FieldSpec } from '@kbn/data-plugin/common'; +import { formatRiskScore } from '../../../../../entity_analytics/common'; import { getAgentTypeForAgentIdField } from '../../../../../common/lib/endpoint/utils/get_agent_type_for_agent_id_field'; import { ALERT_HOST_CRITICALITY, @@ -45,12 +46,7 @@ import { SIGNAL_STATUS_FIELD_NAME, USER_NAME_FIELD_NAME, } from './constants'; -import { - renderEventModule, - RenderRiskScore, - RenderRuleName, - renderUrl, -} from './formatted_field_helpers'; +import { renderEventModule, RenderRuleName, renderUrl } from './formatted_field_helpers'; import { RuleStatus } from './rule_status'; import { HostName } from './host_name'; import { UserName } from './user_name'; @@ -246,7 +242,11 @@ const FormattedFieldValueComponent: React.FC<{ /> ); } else if (fieldName === RISK_SCORE) { - return value ? : null; + return value ? ( + + {formatRiskScore(Number(value))} + + ) : null; } else if (fieldName === EVENT_MODULE_FIELD_NAME) { return renderEventModule({ contextId, diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field_helpers.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field_helpers.tsx index 1a1f8f22500cf..d41c0238ce592 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field_helpers.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field_helpers.tsx @@ -12,7 +12,6 @@ import type { SyntheticEvent } from 'react'; import React, { useCallback, useMemo, useContext } from 'react'; import styled from 'styled-components'; import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; -import { formatRiskScore } from '../../../../../entity_analytics/common'; import { DefaultDraggable } from '../../../../../common/components/draggables'; import { getEmptyTagValue } from '../../../../../common/components/empty_value'; import { getRuleDetailsUrl } from '../../../../../common/components/link_to/redirect_to_detection_engine'; @@ -383,16 +382,3 @@ export const renderUrl = ({ getEmptyTagValue() ); }; - -interface RenderRiskScoreProps { - value: number | string; -} - -export const RenderRiskScore: React.FC = ({ value }) => { - return ( - - {/* Usually is a string */} - {formatRiskScore(Number(value))} - - ); -};