Feature/filter badge

This commit is contained in:
2024-12-02 07:43:58 +00:00
committed by AmirHossein Mahmoodi
parent 87a637291d
commit dd904e13bc
7 changed files with 52 additions and 15 deletions

View File

@@ -2,6 +2,7 @@
import WithAuthMiddleware from "@/core/middlewares/withAuth";
import LoadingHardPage from "@/core/components/LoadingHardPage";
import { useAuth } from "@/lib/contexts/auth";
import { Typography, Stack } from "@mui/material";
const Layout = ({ children }) => {
const { isAuth, initAuthState, errorState } = useAuth();
@@ -9,9 +10,16 @@ const Layout = ({ children }) => {
if (!initAuthState && !isAuth)
return (
<LoadingHardPage
authState={!!errorState}
authState={errorState.status}
label={
!!errorState ? "مشکلی در احراز هویت رخ داده است . دقایقی بعد امتحان کنید!!!" : "درحال احراز هویت..."
errorState.status ? (
<Stack justifyContent={"center"} alignItems={"center"}>
<Typography variant={"body1"}>{errorState.message}</Typography>
<Typography variant={"body1"}> کد : {errorState.status}</Typography>
</Stack>
) : (
<Typography variant={"body1"}>درحال احراز هویت...</Typography>
)
}
loading={true}
/>