From cff36d5b0412aa3e409725bcd082509f18a295f4 Mon Sep 17 00:00:00 2001 From: AmirHossein Mahmoodi Date: Wed, 27 Sep 2023 10:55:36 +0330 Subject: [PATCH] TF-102 fixed follow-up page when no request found --- public/locales/fa/app.json | 3 +- .../dashboard/refahi/followUp-loan/index.jsx | 46 ++++++++----------- 2 files changed, 22 insertions(+), 27 deletions(-) diff --git a/public/locales/fa/app.json b/public/locales/fa/app.json index c91dc84..7289568 100644 --- a/public/locales/fa/app.json +++ b/public/locales/fa/app.json @@ -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": "ثبت درخواست وام", diff --git a/src/components/dashboard/refahi/followUp-loan/index.jsx b/src/components/dashboard/refahi/followUp-loan/index.jsx index 331bab0..32b121d 100644 --- a/src/components/dashboard/refahi/followUp-loan/index.jsx +++ b/src/components/dashboard/refahi/followUp-loan/index.jsx @@ -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 ( - - + + {requestsList == null ? '' : requestsList.length ? ( - - {requestsList.map((item, index) => ( - - ))} - - - - ); + {requestsList.map((item, index) => ())} + ) : ({t('LoanFollowUp.no_request_found')})} + + ); }; export default LoanFollowUpComponent;