diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/RansomwareReport.js b/monkey/monkey_island/cc/ui/src/components/report-components/RansomwareReport.js index 1f5f9b0d7..52ca82c42 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/RansomwareReport.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/RansomwareReport.js @@ -2,6 +2,7 @@ import React from 'react'; import ReportHeader, {ReportTypes} from './common/ReportHeader'; import ReportLoader from './common/ReportLoader'; +import pluralize from 'pluralize' class RansomwareReport extends React.Component { stillLoadingDataFromServer() { @@ -41,22 +42,13 @@ class RansomwareReport extends React.Component { for (let exploit in exploit_counts) { let count = exploit_counts[exploit]; - if (count === 1) { - exploitation_details.push( -
- {count} machine was exploited by - the {exploit}. -
- ); - } - else { - exploitation_details.push( -
- {count} machines were exploited by - the {exploit}. -
- ); - } + exploitation_details.push( +
+ {count}  + {pluralize('machine', count)} {pluralize('was', count)} exploited by the  + {exploit}. +
+ ); } return exploitation_details;