Skip to content

Commit

Permalink
Added a conditional to render statValue
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanGarriuz committed Jan 14, 2025
1 parent a10e28f commit 7aa04fb
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -135,7 +135,7 @@ exports[`Stats component renders correctly to match the snapshot 1`] = `
rel="noreferrer"
style="font-weight: normal; color: rgb(189, 39, 30);"
>
NaN
-
</a>
</span>
</p>
@@ -180,7 +180,7 @@ exports[`Stats component renders correctly to match the snapshot 1`] = `
rel="noreferrer"
style="font-weight: normal; color: rgb(254, 197, 20);"
>
NaN
-
</a>
</span>
</p>
@@ -225,7 +225,7 @@ exports[`Stats component renders correctly to match the snapshot 1`] = `
rel="noreferrer"
style="font-weight: normal; color: rgb(96, 146, 192);"
>
NaN
-
</a>
</span>
</p>
@@ -270,7 +270,7 @@ exports[`Stats component renders correctly to match the snapshot 1`] = `
rel="noreferrer"
style="font-weight: normal; color: rgb(0, 120, 113);"
>
NaN
-
</a>
</span>
</p>
Original file line number Diff line number Diff line change
@@ -155,7 +155,12 @@ export function LastAlertsStat({
}}
href={discoverLocation}
>
{Number(statValue).toLocaleString('en-US')}
{
// statValue can take the value of "-" if countLastAlerts does not exist.
typeof countLastAlerts === 'number'
? Number(statValue).toLocaleString('en-US')
: statValue
}
</EuiLink>
</EuiToolTip>
}

0 comments on commit 7aa04fb

Please sign in to comment.