This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
admin-panel/src/features/AppLoading.tsx

27 lines
509 B
TypeScript

import Spinner, { CENTER_SPINNER } from 'common/Spinner/Spinner';
import { useAuth } from 'libs/auth';
export interface AppLoadingProps {
children: JSX.Element;
}
function AppLoading({ children }: AppLoadingProps) {
const { loading } = useAuth();
if (loading) {
return (
<Spinner
containerProps={{
...CENTER_SPINNER,
minHeight: '100vh',
}}
description="Wczytywanie danych..."
/>
);
}
return children;
}
export default AppLoading;