forked from p15670423/monkey
Island: Deduplicate <p> in renderFileEncryptionStats()
This commit is contained in:
parent
3e2cf1d69c
commit
1f1b9bf2fc
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue