TF-102 fixed follow-up page when no request found

This commit is contained in:
AmirHossein Mahmoodi
2023-09-27 10:55:36 +03:30
parent 650c02e09e
commit cff36d5b04
2 changed files with 22 additions and 27 deletions

View File

@@ -113,7 +113,8 @@
"loan_follow_up_page": "پیگیری درخواست",
"loan_request_correction": "اصلاح درخواست",
"loan_request_detail": "مشاهده جزئیات",
"request_number": "درخواست شماره"
"request_number": "درخواست شماره",
"no_request_found": "درخواستی یافت نشد"
},
"LoanRequest": {
"loan_request_page": "ثبت درخواست وام",

View File

@@ -1,19 +1,18 @@
import DashboardLayouts from "@/layouts/dashboardLayouts";
import {
Grid,
Stack,
} from "@mui/material";
import {Grid, Stack, Typography,} from "@mui/material";
import {useEffect, useState} from "react";
import {SHOW_LOAN_REQUEST_WELFARE} from "@/core/data/apiRoutes";
import useLoading from "@/lib/app/hooks/useLoading";
import useRequest from "@/lib/app/hooks/useRequest";
import moment from "jalali-moment";
import RequestCard from "@/components/dashboard/refahi/followUp-loan/RequestCard";
import {useTranslations} from "next-intl";
const LoanFollowUpComponent = () => {
const t = useTranslations()
const requestServer = useRequest();
const {setLoadingPage} = useLoading();
const [requestsList, setRequestsList] = useState([]);
const [requestsList, setRequestsList] = useState(null);
// get form data
useEffect(() => {
setLoadingPage(true)
@@ -33,28 +32,23 @@ const LoanFollowUpComponent = () => {
})
}, []);
return (
<DashboardLayouts>
<Stack
spacing={2}
sx={{
p: 4,
width: "100%",
}}
return (<DashboardLayouts>
<Stack
spacing={2}
sx={{
p: 4, width: "100%",
}}
>
{requestsList == null ? '' : requestsList.length ? (<Grid
container
columnSpacing={2}
rowSpacing={2}
sx={{alignItems: "start", justifyContent: "center"}}
>
<Grid
container
columnSpacing={2}
rowSpacing={2}
sx={{alignItems: "start", justifyContent: "center"}}
>
{requestsList.map((item, index) => (
<RequestCard item={item} key={item.id}/>
))}
</Grid>
</Stack>
</DashboardLayouts>
);
{requestsList.map((item, index) => (<RequestCard item={item} key={item.id}/>))}
</Grid>) : (<Typography sx={{textAlign: 'center'}}>{t('LoanFollowUp.no_request_found')}</Typography>)}
</Stack>
</DashboardLayouts>);
};
export default LoanFollowUpComponent;