2019-10-27 14:03:39 -07:00
|
|
|
import React, { FC } from 'react';
|
2020-01-27 01:27:43 -08:00
|
|
|
import { useFetch } from '../../hooks/useFetch';
|
|
|
|
import { withStatusIndicator } from '../../components/withStatusIndicator';
|
|
|
|
import { RulesMap, RulesContent } from './RulesContent';
|
2020-10-22 08:22:32 -07:00
|
|
|
import { usePathPrefix } from '../../contexts/PathPrefixContext';
|
|
|
|
import { API_PATH } from '../../constants/constants';
|
2020-01-27 01:27:43 -08:00
|
|
|
|
|
|
|
const RulesWithStatusIndicator = withStatusIndicator(RulesContent);
|
|
|
|
|
2021-08-30 05:05:49 -07:00
|
|
|
const Rules: FC = () => {
|
2020-10-22 08:22:32 -07:00
|
|
|
const pathPrefix = usePathPrefix();
|
|
|
|
const { response, error, isLoading } = useFetch<RulesMap>(`${pathPrefix}/${API_PATH}/rules`);
|
2020-01-27 01:27:43 -08:00
|
|
|
|
|
|
|
return <RulesWithStatusIndicator response={response} error={error} isLoading={isLoading} />;
|
|
|
|
};
|
2019-10-27 14:03:39 -07:00
|
|
|
|
|
|
|
export default Rules;
|