forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
/
risk_score_header_title.tsx
35 lines (32 loc) · 1.2 KB
/
risk_score_header_title.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import React from 'react';
import { RiskScoreEntity } from '../../../../../common/search_strategy';
import { NavItemBetaBadge } from '../../../../common/components/navigation/nav_item_beta_badge';
import * as i18n from '../../../../overview/components/entity_analytics/common/translations';
import { TECHNICAL_PREVIEW } from './translations';
const RiskScoreHeaderTitleComponent = ({
riskScoreEntity,
title,
showTechnicalPreviewBadge = false,
}: {
riskScoreEntity: RiskScoreEntity;
title?: string;
showTechnicalPreviewBadge?: boolean;
}) => {
return (
<>
{title ??
(riskScoreEntity === RiskScoreEntity.user ? i18n.USER_RISK_TITLE : i18n.HOST_RISK_TITLE)}
{showTechnicalPreviewBadge && (
<NavItemBetaBadge text={TECHNICAL_PREVIEW} className="eui-alignMiddle" />
)}
</>
);
};
export const RiskScoreHeaderTitle = React.memo(RiskScoreHeaderTitleComponent);
RiskScoreHeaderTitle.displayName = 'RiskScoreHeaderTitle';