diff options
| author | Ernst Widerberg <ernst@sunet.se> | 2022-04-25 10:13:59 +0200 |
|---|---|---|
| committer | Ernst Widerberg <ernst@sunet.se> | 2022-04-25 10:13:59 +0200 |
| commit | b0a5f0a52c4bdf6ad6af0de2c8d273898a03e0e5 (patch) | |
| tree | 674af99e983dea8c07a824aa6b3113fec74ed746 /src/components/ScanDetail.js | |
| parent | 5d075558c6a47c53c3790847babf95a7ce9f958c (diff) | |
Refactor out utility function
Diffstat (limited to 'src/components/ScanDetail.js')
| -rw-r--r-- | src/components/ScanDetail.js | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/components/ScanDetail.js b/src/components/ScanDetail.js index 34e7a12..9cf4740 100644 --- a/src/components/ScanDetail.js +++ b/src/components/ScanDetail.js @@ -7,6 +7,8 @@ import Tooltip from "@mui/material/Tooltip"; import InfoOutlinedIcon from "@mui/icons-material/InfoOutlined"; +import { resultClassName } from "../util"; + class ScanDetail extends React.Component { render() { return ( @@ -126,18 +128,7 @@ function CustomElement(props) { function Result(props) { return ( <div className="resultContainer"> - <Card - className={ - "result" + - (() => { - if (props.vulnerable) return " vulnerable"; - else if (props.investigation_needed) - return " investigation_needed"; - else return ""; - })() - } - variant="outlined" - > + <Card className={resultClassName(props)} variant="outlined"> {props.display_name} {props.description && ( <Tooltip title={props.description}> |
