import { useState } from "react"; import { useParams, useHistory } from "react-router-dom"; import { Accordion, AccordionSummary, AccordionDetails, Button, Dialog, DialogContent, DialogContentText, DialogTitle, DialogActions, Typography, } from "@material-ui/core"; import ExpandMoreIcon from "@material-ui/icons/ExpandMore.js"; import DeleteIcon from "@material-ui/icons/Delete.js"; import API from "utils/API.js"; function NetworkManagement() { const { nwid } = useParams(); const history = useHistory(); const [open, setOpen] = useState(false); const handleClickOpen = () => { setOpen(true); }; const handleClose = () => { setOpen(false); }; const sendDelReq = async () => { const req = await API.delete("/network/" + nwid); console.log("Action:", req); }; const deleteNetwork = async () => { await sendDelReq(); history.push("/"); history.go(0); }; return ( }> Management {"Are you sure you want to delete this network?"} This action cannot be undone. ); } export default NetworkManagement;