import { useRequest } from 'alova'; import { FeaturesContext } from '.'; import type { FC } from 'react'; import type { RequiredChildrenProps } from 'utils'; import * as FeaturesApi from 'api/features'; import { ApplicationError, LoadingSpinner } from 'components'; const FeaturesLoader: FC = (props) => { const { data: features, error } = useRequest(FeaturesApi.readFeatures); if (features) { return ( {props.children} ); } if (error) { return ; } return ; }; export default FeaturesLoader;