import { gql, useQuery } from "@apollo/client"; import { CircularProgress, List } from "@mui/material"; import { Alert } from "@mui/lab"; import React from "react"; import RuleListItem from "./RuleListItem"; import { ScopeRule } from "../../lib/scope"; export const SCOPE = gql` query Scope { scope { url } } `; function Rules(): JSX.Element { const { loading, error, data } = useQuery<{ scope: ScopeRule[] }>(SCOPE); return (
{loading && } {error && Error fetching scope: {error.message}} {data && data.scope.length > 0 && ( {data.scope.map((rule, index) => ( ))} )}
); } export default Rules;