Island: Deduplicate <p> in renderFileEncryptionStats()

This commit is contained in:
Mike Salvatore 2021-07-13 11:21:56 -04:00 committed by GitHub
parent 3e2cf1d69c
commit 1f1b9bf2fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -2,11 +2,14 @@ import React from 'react';
function renderFileEncryptionStats(successful: number, total: number) {
if(successful > 0){
return (<p className={"text-success"}>{successful} out of {total}</p>);
let textClassName = ""
if(successful > 0) {
textClassName = "text-success"
} else {
return (<p className={"text-danger"}>{successful} out of {total}</p>);
textClassName = "text-danger"
}
return (<p className={textClassName}>{successful} out of {total}</p>);
}
export default renderFileEncryptionStats;