Skip to content

Commit

Permalink
fix i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
patrykkopycinski committed Sep 2, 2020
1 parent 55009e5 commit 1d15571
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,15 @@ const OverviewHostComponent: React.FC<OverviewHostProps> = ({
[navigateToApp, urlSearch]
);

const subtitleValues = useMemo(() => {
const hostEventsCount = getOverviewHostStats(overviewHost).reduce(
(total, stat) => total + stat.count,
0
);
const formattedHostEventsCount = numeral(hostEventsCount).format(defaultNumberFormat);
const hostEventsCount = useMemo(
() => getOverviewHostStats(overviewHost).reduce((total, stat) => total + stat.count, 0),
[overviewHost]
);

return {
formattedHostEventsCount,
hostEventsCount,
};
}, [defaultNumberFormat, overviewHost]);
const formattedHostEventsCount = useMemo(
() => numeral(hostEventsCount).format(defaultNumberFormat),
[defaultNumberFormat, hostEventsCount]
);

const hostPageButton = useMemo(
() => (
Expand All @@ -96,7 +93,10 @@ const OverviewHostComponent: React.FC<OverviewHostProps> = ({
<FormattedMessage
defaultMessage="Showing: {formattedHostEventsCount} {hostEventsCount, plural, one {event} other {events}}"
id="xpack.securitySolution.overview.overviewHost.hostsSubtitle"
values={subtitleValues}
values={{
hostEventsCount,
formattedHostEventsCount,
}}
/>
) : (
<>{''}</>
Expand Down

0 comments on commit 1d15571

Please sign in to comment.