mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-07-31 08:20:25 +00:00
Prevent the crash on client-side in case of text
being undefined in FancyTextDisplay
(#481)
* Prevent the crash on client-side in case of `text` being undefined in `FancyTextDisplay` * Use `String(text)` instead
This commit is contained in:
parent
ad78f1dcd7
commit
dd53a36d5f
@ -17,6 +17,7 @@ interface Props {
|
||||
const FancyTextDisplay: React.FC<Props> = ({text, className, isPossibleToCopy = true, applyTextEllipsis = true, flipped = false, useTooltip= false, displayIconOnMouseOver = false, buttonOnly = false}) => {
|
||||
const [showCopiedNotification, setCopied] = useState(false);
|
||||
const [showTooltip, setShowTooltip] = useState(false);
|
||||
text = String(text);
|
||||
|
||||
const onCopy = () => {
|
||||
setCopied(true)
|
||||
@ -47,7 +48,7 @@ const FancyTextDisplay: React.FC<Props> = ({text, className, isPossibleToCopy =
|
||||
return (
|
||||
<p
|
||||
className={`FancyTextDisplay-Container ${className ? className : ''} ${displayIconOnMouseOver ? 'displayIconOnMouseOver ' : ''} ${applyTextEllipsis ? ' FancyTextDisplay-ContainerEllipsis' : ''}`}
|
||||
title={text.toString()}
|
||||
title={text}
|
||||
onMouseOver={ e => setShowTooltip(true)}
|
||||
onMouseLeave={ e => setShowTooltip(false)}
|
||||
>
|
||||
|
Loading…
Reference in New Issue
Block a user