From 9a0ed2d78c30b17eb939bc13db26e5c9f078604f Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sun, 28 Sep 2025 08:08:36 -0400 Subject: [PATCH] home lnk --- src/components/home/HomeCom.jsx | 335 +++++++++++++++++--------------- 1 file changed, 173 insertions(+), 162 deletions(-) diff --git a/src/components/home/HomeCom.jsx b/src/components/home/HomeCom.jsx index b88233e..8beceb4 100644 --- a/src/components/home/HomeCom.jsx +++ b/src/components/home/HomeCom.jsx @@ -1,13 +1,13 @@ import React from 'react' -import {Link} from 'react-router-dom' -import { useQuery } from "@tanstack/react-query"; +import {Link} from 'react-router-dom' +import {useQuery} from "@tanstack/react-query"; import BreadcrumbCom from '../../components/breadcrumb/BreadcrumbCom' import CustomCounter from '../../components/CustomCounter' import Icons from '../../components/Icons' import formatNumber from '../../helpers/formatNumber' import queryKeys from '../../services/queryKeys' -import { getDashData } from '../../services/siteServices' +import {getDashData} from '../../services/siteServices' import getDateFromDateString from '../../helpers/GetDateFromDateString'; import getTimeFromDateString from '../../helpers/GetTimeFromDateString'; import localImgLoader from '../../helpers/localImageLoader'; @@ -15,176 +15,187 @@ import RouteLinks from '../../RouteLinks'; export default function HomeCom() { - const {data, isFetching, isError, error} = useQuery({ - queryKey: queryKeys.dashboard, - queryFn: () => getDashData(), - }) + const {data, isFetching, isError, error} = useQuery({ + queryKey: queryKeys.dashboard, + queryFn: () => getDashData(), + }) - const dashData = data?.data // DASHBOARD DATA + const dashData = data?.data // DASHBOARD DATA - // console.log('dashData', dashData) - // loans, payments, recent_transactions [], request_summary + // console.log('dashData', dashData) + // loans, payments, recent_transactions [], request_summary - return ( -
- + return ( +
+ - {(isFetching || isError) ? -
- {isError ?

{error.message}

:

Loading...

} -
- : -
-
-
-

Subscriptions

-
- {/*

{dashData?.loans?.currency_text}

*/} -

+ {(isFetching || isError) ? +

+ {isError ?

{error.message}

: +

Loading...

} +
+ : +
+
+
+

Subscriptions

+
+ {/*

{dashData?.loans?.currency_text}

*/} +

{/*{dashData?.loans?.currency_text}*/} - -

-

{dashData?.loans?.text}

-
-
-
-

Payments

-
-

+ +

+

{dashData?.loans?.text}

+
+
+
+

Payments

+
+

{dashData?.payments?.currency_text} - -

-

{dashData?.payments?.text}

-
-
-
-

Provision Summary

-
- { - Object.values(dashData?.request_summary).map((item, index) => { - return ( -
-
- + +

+

{dashData?.payments?.text}

+
+
+
+

Provision Summary

+
+ { + Object.values(dashData?.request_summary).map((item, index) => { + return ( +
+
+ +
+
+

+

{Object.keys(item)[0]}

+
+
+ ) + }) + } +
+
-
-

-

{Object.keys(item)[0]}

-
-
- ) - }) - } -
-
-
-
-
-
-
-

Recent Subscriptions

- {/*

Over 500 members

*/} -
- {/*
+
+
+
+
+

Recent Subscriptions

+ {/*

Over 500 members

*/} +
+ {/*
*/} -
- - - - - - - - - - - - {(dashData?.subscription && dashData?.subscription.length > 0) ? dashData?.subscription?.map((item, index) => { - if(index <= 10) { - return ( - - - - - - - ) - }else{ - return null - } - } - ) - : - - - - } - <> - {dashData?.subscription.length > 10 && - - - - } - - -
- Subscription - - Status - - Activity - - Action -
-
- Icon -
-
{item?.product_id}
-
{getDateFromDateString(item?.added)} {getTimeFromDateString(item?.added)}
-
-
-
-
- -
{item?.status}
-
-
-
-
50%
-
-
-
-
-
-
- {/*
- -
*/} -
- - - -
- {/*
- -
*/} -
-
-
- No Record Found
-
- - More ... - -
-
+ + + + + + + + + + + {(dashData?.subscription && dashData?.subscription.length > 0) ? dashData?.subscription?.map((item, index) => { + if (index <= 10) { + return ( + + + + + + + ) + } else { + return null + } + } + ) + : + + + + } + <> + {dashData?.subscription.length > 10 && + + + + } + + +
+ Subscription + + Status + + Activity + + Action +
+
+ Icon +
+
{item?.product_id}
+
{getDateFromDateString(item?.added)} {getTimeFromDateString(item?.added)}
+
+
+
+
+ +
{item?.status}
+
+
+
+
50%
+
+
+
+
+
+
+
+ + + +
+
+
+
+ No Record Found +
+
+ + More ... + +
+ +
+
+
+ }
-
- } -
- ) + ) } \ No newline at end of file