ui: refactor duplicate code in getWarning()

This commit is contained in:
Mike Salvatore 2021-01-28 13:27:36 -05:00
parent 61eb9a7a23
commit 08926d778b
1 changed files with 14 additions and 15 deletions

View File

@ -75,23 +75,22 @@ function getBody(props) {
function getWarning(warningType) {
if (warningType == WarningType.SINGLE) {
return (
<div className={'info-pane-warning'} key={'warning'}>
<WarningIcon/>This option may cause a system to become unstable or may
change a system's state in undesirable ways. Therefore, this option
is not recommended for use in production or other sensitive environments.
</div>
);
var warning = <span>This option may cause a system to become unstable or
may change a system's state in undesirable ways. Therefore, this option
is not recommended for use in production or other sensitive
environments.</span>;
} else {
return (
<div className={'info-pane-warning'} key={'warning'}>
<WarningIcon/>Some options have been selected that may cause a system
warning = <span>Some options have been selected that may cause a system
to become unstable or may change a system's state in undesirable ways.
Running Infection Monkey in a production or other sensitive environment
with this configuration is not recommended.
with this configuration is not recommended.</span>;
}
return (
<div className={'info-pane-warning'} key={'warning'}>
<WarningIcon/>{warning}
</div>
);
}
}
export {getDefaultPaneParams, InfoPane, WarningType}