github.com/thanos-io/thanos@v0.32.5/pkg/ui/react-app/src/pages/rules/Rules.tsx (about) 1 import React, { FC } from 'react'; 2 import { RouteComponentProps } from '@reach/router'; 3 import PathPrefixProps from '../../types/PathPrefixProps'; 4 import { useFetch } from '../../hooks/useFetch'; 5 import { withStatusIndicator } from '../../components/withStatusIndicator'; 6 import { RulesMap, RulesContent } from './RulesContent'; 7 8 const RulesWithStatusIndicator = withStatusIndicator(RulesContent); 9 10 const Rules: FC<RouteComponentProps & PathPrefixProps> = ({ pathPrefix }) => { 11 const { response, error, isLoading } = useFetch<RulesMap>(`${pathPrefix}/api/v1/rules`); 12 13 return <RulesWithStatusIndicator response={response} error={error} isLoading={isLoading} />; 14 }; 15 16 export default Rules;