@@ -2,7 +2,7 @@ import React from 'react';
22import PropTypes from 'prop-types' ;
33import cn from 'bem-cn-lite' ;
44import { Link } from 'react-router-dom' ;
5- import { ClipboardButton , Link as ExternalLink , Button , Icon } from '@gravity-ui/uikit' ;
5+ import { ClipboardButton , Link as UIKitLink , Button , Icon } from '@gravity-ui/uikit' ;
66
77import circleInfoIcon from '../../assets/icons/circle-info.svg' ;
88import circleExclamationIcon from '../../assets/icons/circle-exclamation.svg' ;
@@ -35,6 +35,7 @@ class EntityStatus extends React.Component {
3535 externalLink : PropTypes . bool ,
3636 className : PropTypes . string ,
3737 mode : PropTypes . oneOf ( [ 'color' , 'icons' ] ) ,
38+ withLeftTrim : PropTypes . bool ,
3839 } ;
3940
4041 static defaultProps = {
@@ -45,6 +46,7 @@ class EntityStatus extends React.Component {
4546 showStatus : true ,
4647 externalLink : false ,
4748 mode : 'color' ,
49+ withLeftTrim : false ,
4850 } ;
4951 renderIcon ( ) {
5052 const { status, size, showStatus, mode} = this . props ;
@@ -56,12 +58,7 @@ class EntityStatus extends React.Component {
5658 const modifiers = { state : status . toLowerCase ( ) , size} ;
5759
5860 if ( mode === 'icons' && icons [ status ] ) {
59- return (
60- < Icon
61- className = { b ( 'status-icon' , modifiers ) }
62- data = { icons [ status ] }
63- />
64- ) ;
61+ return < Icon className = { b ( 'status-icon' , modifiers ) } data = { icons [ status ] } /> ;
6562 }
6663
6764 return < div className = { b ( 'status-color' , modifiers ) } /> ;
@@ -70,21 +67,25 @@ class EntityStatus extends React.Component {
7067 const { iconPath} = this . props ;
7168
7269 return (
73- < ExternalLink target = "_blank" href = { iconPath } >
70+ < UIKitLink target = "_blank" href = { iconPath } >
7471 { this . renderIcon ( ) }
75- </ ExternalLink >
72+ </ UIKitLink >
7673 ) ;
7774 }
7875 renderLink ( ) {
7976 const { externalLink, name, path, onNameMouseEnter, onNameMouseLeave} = this . props ;
8077
8178 if ( externalLink ) {
82- return < ExternalLink href = { path } > { name } </ ExternalLink > ;
79+ return (
80+ < UIKitLink className = { b ( 'name' ) } href = { path } >
81+ { name }
82+ </ UIKitLink >
83+ ) ;
8384 }
8485
8586 return path ? (
8687 < Link
87- title = { name }
88+ className = { b ( ' name' ) }
8889 to = { path }
8990 onMouseEnter = { onNameMouseEnter }
9091 onMouseLeave = { onNameMouseLeave }
@@ -95,7 +96,6 @@ class EntityStatus extends React.Component {
9596 name && (
9697 < span
9798 className = { b ( 'name' ) }
98- title = { name }
9999 onMouseEnter = { onNameMouseEnter }
100100 onMouseLeave = { onNameMouseLeave }
101101 >
@@ -108,14 +108,16 @@ class EntityStatus extends React.Component {
108108 const { name, label, iconPath, hasClipboardButton, className} = this . props ;
109109
110110 return (
111- < div className = { b ( null , className ) } >
111+ < div className = { b ( null , className ) } title = { name } >
112112 { iconPath ? this . renderStatusLink ( ) : this . renderIcon ( ) }
113113 { label && (
114114 < span title = { label } className = { b ( 'label' ) } >
115115 { label }
116116 </ span >
117117 ) }
118- { this . renderLink ( ) }
118+ < span className = { b ( 'link' , { 'with-left-trim' : this . props . withLeftTrim } ) } >
119+ { this . renderLink ( ) }
120+ </ span >
119121 { hasClipboardButton && (
120122 < Button
121123 component = "span"
0 commit comments