From 1f1b9bf2fcca6fadc565c05b6ad978daaa847670 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 13 Jul 2021 11:21:56 -0400 Subject: [PATCH] Island: Deduplicate

in renderFileEncryptionStats() --- .../common/RenderFileEncryptionStats.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/common/RenderFileEncryptionStats.tsx b/monkey/monkey_island/cc/ui/src/components/report-components/common/RenderFileEncryptionStats.tsx index 7e5853c14..fb6c612a9 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/common/RenderFileEncryptionStats.tsx +++ b/monkey/monkey_island/cc/ui/src/components/report-components/common/RenderFileEncryptionStats.tsx @@ -2,11 +2,14 @@ import React from 'react'; function renderFileEncryptionStats(successful: number, total: number) { - if(successful > 0){ - return (

{successful} out of {total}

); + let textClassName = "" + if(successful > 0) { + textClassName = "text-success" } else { - return (

{successful} out of {total}

); + textClassName = "text-danger" } + + return (

{successful} out of {total}

); } export default renderFileEncryptionStats;