import React, { useEffect, useState } from 'react';
import { useTheme } from '@material-ui/core/styles';
import Grid from '@material-ui/core/Grid';
import Card from '@material-ui/core/Card';
import CardActionArea from '@material-ui/core/CardActionArea';
import CardContent from '@material-ui/core/CardContent';
import CardHeader from '@material-ui/core/CardHeader';
import Typography from '@material-ui/core/Typography';
import Button from '@material-ui/core/Button';
const Workflows = (props) => {
const { globalUrl, isLoggedIn, isLoaded, } = props
const theme = useTheme();
const [curView, setCurView] = useState(0);
const [firstrequest, setFirstrequest] = useState(true)
const [selectedItems, setSelectedItems] = useState([])
const viewdata1 = [
{
"title": "General",
"content": "Learn about our ticketing solutions",
"subitems": [
{
"name": "Search",
"subtitle": "Search for anything, anywhere",
},
{
"name": "Message",
"subtitle": "Read and send messages",
},
{
"name": "Parse emails",
"subtitle": "what",
},
],
},
{
"title": "Ticketing",
"subitems": [
{
"name": "Search",
"subtitle": "Search for anything, anywhere",
},
{
"name": "Message",
"subtitle": "Read and send messages",
},
{
"name": "Parse emails",
"subtitle": "what",
},
],
},
{
"title": "Threat intel",
"subitems": [
{
"name": "Search",
"subtitle": "Search for anything, anywhere",
},
{
"name": "Message",
"subtitle": "Read and send messages",
},
{
"name": "Parse emails",
"subtitle": "what",
},
],
},
]
if (firstrequest) {
setFirstrequest(false)
if (props.match.params.key) {
console.log("PROPS: ", props.match.params.key)
const viewitem = viewdata1.find(item => item.title.toLowerCase() === props.match.params.key.toLowerCase())
if (viewitem !== undefined && viewitem !== null) {
setCurView(1)
//setSelectedItem(viewitem)
}
}
}
const cardContentStyle = {
height: "100%",
width: "100%",
padding: 40,
}
const outerGridView = {
width: "100%",
marginTop: 15,
}
const paperStyle = {
height: 300,
color: "white",
backgroundColor: theme.palette.surfaceColor,
color: "white",
cursor: "pointer",
display: "flex",
textAlign: "center",
}
const HandleSelection = (data) => {
const [selected, setSelected] = useState(false);
var baseStyle = JSON.parse(JSON.stringify(paperStyle))
if (selected) {
baseStyle.backgroundColor = "white"
baseStyle.color = "black"
}
return (