diff --git a/src/components/Dashboard/common/ObjectDisplay.jsx b/src/components/Dashboard/common/ObjectDisplay.jsx index 88af03c..57fa390 100644 --- a/src/components/Dashboard/common/ObjectDisplay.jsx +++ b/src/components/Dashboard/common/ObjectDisplay.jsx @@ -9,6 +9,7 @@ import { AuthContext } from '../context/AuthContext' import merge from 'lodash/merge' import IdDisplay from './IdDisplay' import SpotlightTooltip from './SpotlightTooltip' +import StateTag from './StateTag' const { Text, Link } = Typography @@ -255,7 +256,7 @@ const ObjectDisplay = ({ className='object-display-tag' > @@ -267,6 +268,13 @@ const ObjectDisplay = ({ style={{ marginBottom: '1.5px' }} /> ) : null} + {objectData?.state ? ( + + ) : null}
{renderNameDisplay()} diff --git a/src/components/Dashboard/common/StateTag.jsx b/src/components/Dashboard/common/StateTag.jsx index 7c9c1b9..a812f95 100644 --- a/src/components/Dashboard/common/StateTag.jsx +++ b/src/components/Dashboard/common/StateTag.jsx @@ -2,7 +2,7 @@ import PropTypes from 'prop-types' import { Badge, Flex, Tag } from 'antd' import { useMemo } from 'react' -const StateTag = ({ state, showBadge = true, style = {} }) => { +const StateTag = ({ state, showBadge = true, showTag = true, style = {} }) => { const { badgeStatus, badgeText } = useMemo(() => { let status = 'default' let text = 'Unknown' @@ -196,6 +196,10 @@ const StateTag = ({ state, showBadge = true, style = {} }) => { badgeProps = { color: badgeStatus } } + if (showTag == false) { + return + } + return ( @@ -209,7 +213,8 @@ const StateTag = ({ state, showBadge = true, style = {} }) => { StateTag.propTypes = { state: PropTypes.string, showBadge: PropTypes.bool, - style: PropTypes.object + style: PropTypes.object, + showTag: PropTypes.bool } export default StateTag