diff --git a/src/_digifi/partials/widgets/lists/ListsWidget3.tsx b/src/_digifi/partials/widgets/lists/ListsWidget3.tsx index d80711a..ef2edf2 100644 --- a/src/_digifi/partials/widgets/lists/ListsWidget3.tsx +++ b/src/_digifi/partials/widgets/lists/ListsWidget3.tsx @@ -3,37 +3,14 @@ import React from 'react' import { NewDateTimeFormatter } from '../../../lib/NewDateTimeFormatter' // import {KTIcon} from '../../../helpers' // import {Dropdown1} from '../../content/dropdown/Dropdown1' - -type dashDataProps = { - loading: boolean, - data: { - call_return?: string - recent_applications? : {}[] - recent_bvn?: { - id?: string - uid?: string - bvn?: string - status?: string - added?: string - updated?: string - firstname?: string | null - lastname?: string | null - middlename?: string | null - gender?: string | null - birthdate?: string | null - phone?: string | null - nationality?: string | null - }[] - } -} +import { dashDataProps } from '../../../../app/pages/dashboard/model' type Props = { className: string - dashData: dashDataProps + dashData?: dashDataProps } const ListsWidget3: React.FC = ({dashData, className}) => { - console.log('dashData', dashData.data) return (
{/* begin::Header */} @@ -57,7 +34,7 @@ const ListsWidget3: React.FC = ({dashData, className}) => { {/* end::Header */} {/* begin::Body */}
- {dashData.loading ? + {dashData?.loading ? null : dashData?.data?.recent_bvn && dashData?.data?.recent_bvn.length ? diff --git a/src/_digifi/partials/widgets/tables/TablesWidget10.tsx b/src/_digifi/partials/widgets/tables/TablesWidget10.tsx index df9d329..b764410 100644 --- a/src/_digifi/partials/widgets/tables/TablesWidget10.tsx +++ b/src/_digifi/partials/widgets/tables/TablesWidget10.tsx @@ -1,12 +1,18 @@ import { FC } from 'react' import {KTIcon, toAbsoluteUrl} from '../../../helpers' +import { dashDataProps } from '../../../../app/pages/dashboard/model' +import { NewDateTimeFormatter } from '../../../lib/NewDateTimeFormatter' + + type Props = { className: string + dashData?: dashDataProps } -const TablesWidget10: FC = ({className}) => { +const TablesWidget10: FC = ({className, dashData}) => { + console.log('dashData', dashData?.data?.recent_applications) return (
{/* begin::Header */} @@ -32,7 +38,11 @@ const TablesWidget10: FC = ({className}) => {
*/}
{/* end::Header */} + {/* begin::Body */} + {dashData?.loading ? + null + :
{/* begin::Table container */}
@@ -61,334 +71,80 @@ const TablesWidget10: FC = ({className}) => { {/* end::Table head */} {/* begin::Table body */} - - -
- -
- - -
-
- + {dashData?.data.recent_applications && dashData?.data.recent_applications.length ? + dashData?.data.recent_applications.map(item => ( + + +
+
-
- - Ana Simmons + + +
+
+ +
+
+ + {item?.firstname} {item?.lastname} + + + {NewDateTimeFormatter(item?.added)} + +
+
+ + + + Intertico + + + Web, UI/UX Design + + + +
+
+ 50% +
+
+
+
+
+ + +
+ + - - HTML, JS, ReactJS - -
-
- - - - Intertico - - - Web, UI/UX Design - - - -
-
- 50% -
-
-
-
-
- - - - - - - -
- -
- - -
-
- -
-
- - Jessie Clarcson + + - - C#, ASP.NET, MS SQL - -
-
- - - - Agoda - - - Houses & Hotels - - - -
-
- 70% -
-
-
-
-
- - - - - - - -
- -
- - -
-
- -
-
- - Lebron Wayde + + - - PHP, Laravel, VueJS -
-
- - - - RoadGee - - - Transportation - - - -
-
- 60% -
-
-
-
-
- - - - - + + + )) + : - -
- -
- - -
-
- -
-
- - Natali Goodwin - - - Python, PostgreSQL, ReactJS - -
-
- - - - The Hill - - Insurance - - -
-
- 50% -
-
-
-
-
- - - - - - - -
- -
- - -
-
- -
-
- - Kevin Leonard - - - HTML, JS, ReactJS - -
-
- - - - RoadGee - - - Art Director - - - -
-
- 90% -
-
-
-
-
- - - - + No data found! + } {/* end::Table body */} @@ -396,7 +152,9 @@ const TablesWidget10: FC = ({className}) => {
{/* end::Table container */}
+ } {/* begin::Body */} +
) } diff --git a/src/app/pages/dashboard/DashboardWrapper.tsx b/src/app/pages/dashboard/DashboardWrapper.tsx index 07a6a50..5d889fd 100644 --- a/src/app/pages/dashboard/DashboardWrapper.tsx +++ b/src/app/pages/dashboard/DashboardWrapper.tsx @@ -96,7 +96,7 @@ const DashboardPage: FC = () => {
{/* RECENT LOAN APPLICATION */}
- +
{/* end::Row */} diff --git a/src/app/pages/dashboard/model.ts b/src/app/pages/dashboard/model.ts new file mode 100644 index 0000000..8ff8fd2 --- /dev/null +++ b/src/app/pages/dashboard/model.ts @@ -0,0 +1,38 @@ +export type dashDataProps = { + loading: boolean, + data: { + call_return?: string + recent_applications? : { + firstname?: string + lastname?: string + uid?: string + loan_amount?: string + payment_month?: string + sales_agent?: string + gender?: string | null + marital_status?: string + email?: string + address?: string + state?: string + country?: string + status?: string + added?: string + updated?: string + }[] + recent_bvn?: { + id?: string + uid?: string + bvn?: string + status?: string + added?: string + updated?: string + firstname?: string | null + lastname?: string | null + middlename?: string | null + gender?: string | null + birthdate?: string | null + phone?: string | null + nationality?: string | null + }[] + } + } \ No newline at end of file