import React from "react"; import { Container, Box, TextField, Switch, Card, CardContent, IconButton, Typography, Button, } from "@mui/material"; import EditIcon from "@mui/icons-material/Edit"; import { styled } from "@mui/system"; import { toast } from "react-toastify"; const ConnectedButton = styled(Button)({ backgroundColor: "red", color: "white", }); const disableRule = (fileId) => { } const RuleCard = ({ ruleName, description, ...otherProps }) => { const [additionalProps, setAdditionalProps] = React.useState(otherProps); return (
{ruleName}
{description} {/* we need icons here ??? */}
) } const Detection = (props) => { const {globalUrl} = props; const [ruleInfo, setRuleInfo] = React.useState([]); const getSigmaInfo = () => { const url = globalUrl + "/api/v1/files/detection/sigma_rules" fetch(url, { method: "GET", credentials: "include", headers: { "Content-Type": "application/json", }, }) .then((response) => response.json().then((responseJson) => { if (responseJson["success"] === false) { toast("Failed to get sigma rules"); } else { setRuleInfo(responseJson); } }), ) .catch((error) => { console.log("Error in geting sigma files: ", error); }); } React.useEffect(() => { getSigmaInfo() }, []); return ( Group 1 Title Not Connected to SIEM Global disable/enable {ruleInfo.length > 0 && ruleInfo.map((card) => ( ))} ); }; export default Detection;