mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
We want to upgrade to React 17, but Reach Router does not work with React 17: https://github.com/reach/router/issues/429 Also, the Reach + React Router projects announced an intention to join forces and just continue as React Router: https://reacttraining.com/blog/reach-react-router-future/ Signed-off-by: Julius Volz <julius.volz@gmail.com>
18 lines
689 B
TypeScript
18 lines
689 B
TypeScript
import React, { FC } from 'react';
|
|
import { useFetch } from '../../hooks/useFetch';
|
|
import { withStatusIndicator } from '../../components/withStatusIndicator';
|
|
import { RulesMap, RulesContent } from './RulesContent';
|
|
import { usePathPrefix } from '../../contexts/PathPrefixContext';
|
|
import { API_PATH } from '../../constants/constants';
|
|
|
|
const RulesWithStatusIndicator = withStatusIndicator(RulesContent);
|
|
|
|
const Rules: FC = () => {
|
|
const pathPrefix = usePathPrefix();
|
|
const { response, error, isLoading } = useFetch<RulesMap>(`${pathPrefix}/${API_PATH}/rules`);
|
|
|
|
return <RulesWithStatusIndicator response={response} error={error} isLoading={isLoading} />;
|
|
};
|
|
|
|
export default Rules;
|