summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/ListItem.js12
-rw-r--r--src/components/ScanDetail.js15
2 files changed, 6 insertions, 21 deletions
diff --git a/src/components/ListItem.js b/src/components/ListItem.js
index 2951c48..dcafe24 100644
--- a/src/components/ListItem.js
+++ b/src/components/ListItem.js
@@ -3,6 +3,8 @@ import React from "react";
import Button from "@mui/material/Button";
import Card from "@mui/material/Card";
+import { resultClassName } from "../util";
+
class ListItem extends React.Component {
render() {
return (
@@ -26,15 +28,7 @@ class ListItem extends React.Component {
<td>{this.props.system_name}</td>
<td style={{ paddingRight: 0 }}>
<Card
- className={
- "result" +
- (() => {
- if (this.props.vulnerable) return " vulnerable";
- else if (this.props.investigation_needed)
- return " investigation_needed";
- else return "";
- })()
- }
+ className={resultClassName(this.props)}
variant="outlined"
>
{this.props.display_name}
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}>