import { gql, useQuery } from "@apollo/client"; import { CircularProgress, createStyles, List, makeStyles, Theme, } from "@material-ui/core"; import { Alert } from "@material-ui/lab"; import React from "react"; import RuleListItem from "./RuleListItem"; const useStyles = makeStyles((theme: Theme) => createStyles({ rulesList: { backgroundColor: theme.palette.background.paper, }, }) ); export const SCOPE = gql` query Scope { scope { url } } `; function Rules(): JSX.Element { const classes = useStyles(); const { loading, error, data } = useQuery(SCOPE); return (
{loading && } {error && ( Error fetching scope: {error.message} )} {data?.scope.length > 0 && ( {data.scope.map((rule, index) => ( ))} )}
); } export default Rules;