From 5aa5facf1f58a0a2e063e352e84df4e5f86b4965 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 13 Jul 2021 11:26:07 -0400 Subject: [PATCH] Island: Move renderFileEncryptionStats to FileEncryptionTable.tsx --- .../common/RenderFileEncryptionStats.tsx | 15 --------------- .../ransomware/FileEncryptionTable.tsx | 13 ++++++++++++- 2 files changed, 12 insertions(+), 16 deletions(-) delete mode 100644 monkey/monkey_island/cc/ui/src/components/report-components/common/RenderFileEncryptionStats.tsx 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 deleted file mode 100644 index fb6c612a9..000000000 --- a/monkey/monkey_island/cc/ui/src/components/report-components/common/RenderFileEncryptionStats.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import React from 'react'; - - -function renderFileEncryptionStats(successful: number, total: number) { - let textClassName = "" - if(successful > 0) { - textClassName = "text-success" - } else { - textClassName = "text-danger" - } - - return (

{successful} out of {total}

); -} - -export default renderFileEncryptionStats; diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/ransomware/FileEncryptionTable.tsx b/monkey/monkey_island/cc/ui/src/components/report-components/ransomware/FileEncryptionTable.tsx index 8be659eab..270b214a0 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/ransomware/FileEncryptionTable.tsx +++ b/monkey/monkey_island/cc/ui/src/components/report-components/ransomware/FileEncryptionTable.tsx @@ -1,7 +1,6 @@ import React from 'react'; import ReactTable from 'react-table'; import {renderArray} from '../common/RenderArrays'; -import renderFileEncryptionStats from "../common/renderFileEncryptionStats"; type Props = { @@ -51,5 +50,17 @@ const columns = [ } ]; +function renderFileEncryptionStats(successful: number, total: number) { + let textClassName = '' + + if(successful > 0) { + textClassName = 'text-success' + } else { + textClassName = 'text-danger' + } + + return (

{successful} out of {total}

); +} + export default FileEncryptionTable;