import React from "react"; import { makeStyles } from "@material-ui/core/styles"; import Container from "@material-ui/core/Container"; import Grid from "@material-ui/core/Grid"; import TasksTable from "../components/TasksTable"; import { useParams, useLocation } from "react-router-dom"; const useStyles = makeStyles((theme) => ({ container: { paddingLeft: 0, marginLeft: 0, height: "100%", }, gridContainer: { height: "100%", paddingBottom: 0, }, gridItem: { height: "100%", paddingBottom: 0, }, })); function useQuery(): URLSearchParams { return new URLSearchParams(useLocation().search); } interface RouteParams { qname: string; } const validStatus = ["active", "pending", "scheduled", "retry", "dead"]; const defaultStatus = "active"; function TasksView() { const classes = useStyles(); const { qname } = useParams(); const query = useQuery(); let selected = query.get("status"); if (!selected || !validStatus.includes(selected)) { selected = defaultStatus; } return ( ); } export default TasksView;