Compare commits

...

7 Commits

Author SHA1 Message Date
victorAnumudu 6b883c35eb updated some tables 2025-04-10 10:06:53 +01:00
ameye 55e5b9606a Merge branch 'login-page-updated' of DigiFi/digifi-FirstOffice into master 2025-04-09 16:39:10 +00:00
victorAnumudu 14b0f4078c updated login page 2025-04-09 17:23:07 +01:00
ameye 2fe6825739 Merge branch 'login-page' of DigiFi/digifi-FirstOffice into master 2025-04-09 16:05:28 +00:00
victorAnumudu c716d73e22 login page started 2025-04-09 16:59:11 +01:00
Olusesan Ameye 2024f21019 Registry 2025-04-09 01:41:41 +00:00
ameye ae826a2f96 Merge branch 'selected-loan' of DigiFi/digifi-FirstOffice into master 2025-04-08 17:50:58 +00:00
8 changed files with 408 additions and 365 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
version: '3'
services:
digifi-office:
image: registry.chiefsoft.net/digifi-firstoffice:latest
build:
context: .
dockerfile: Dockerfile
@@ -28,4 +29,4 @@ networks:
driver: bridge
ipam:
config:
- subnet: 172.15.56.0/24
- subnet: 172.15.56.0/24
@@ -26,97 +26,103 @@ export default function LoanOffersCom() {
<div className='w-full flex flex-col gap-8'>
<BreadcrumbCom title='Applications' paths={['Dashboard', 'Applications']} />
{isFetching ?
<>
<div className="w-full py-4">
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
{isFetching ?
<>
<p className='text-slate-800'>Loading...</p>
</div>
</>
: isError ?
<div className="w-full py-4">
</>
: isError ?
<p className='text-red-500'>{error.message}</p>
</div>
:
<TableWrapper data={appliedUsers} itemsPerPage={15}>
{({ data }) => (
<>
<table className="py-2 w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400">
<thead className="text-sm md:text-base text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400">
<tr>
<th scope="col" className="px-4 py-2">
Name
</th>
<th scope="col" className="px-4 py-2">
Loan
</th>
<th scope="col" className="px-4 py-2">
Amount
</th>
<th scope="col" className="px-4 py-2">
Added
</th>
<th scope="col" className="px-4 py-2">
Verified
</th>
<th scope="col" className="px-4 py-2">
Action
</th>
</tr>
</thead>
<tbody>
{(data && data.length > 0) ? data?.map((item, index) => (
<tr key={index} className="bg-white border-b dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600">
<th scope="row" className="mr-4 flex items-center px-3 py-2 text-gray-900 whitespace-nowrap dark:text-white">
<img className="w-10 h-10 rounded-full" src={Avatar} alt="Jese image" />
<div className="px-3">
<div className="text-base font-semibold">{item?.name || ''}</div>
<div className="font-normal text-gray-500">{item?.bvn}</div>
</div>
:
<TableWrapper data={appliedUsers} itemsPerPage={15}>
{({ data }) => (
<>
<table className="py-2 w-full text-sm">
<thead className="py-2 text-sm text-slate-500 text-left">
<tr>
<th scope="col" className="px-2 py-2">
Name
</th>
<td className="px-3 py-2">
{item?.loan} - {item?.description}
</td>
<td className="px-3 py-2">
{item?.amount || ''}
</td>
<td className="px-3 py-2">
<div className="flex items-center">
{getDateFromDateString(item?.added)} {getTimeFromDateString(item?.added)}
<th scope="col" className="px-2">
Loan
</th>
<th scope="col" className="px-2">
Amount
</th>
<th scope="col" className="px-2">
Added
</th>
<th scope="col" className="px-2">
Verified
</th>
<th scope="col" className="px-2 text-right">
Action
</th>
</tr>
</thead>
<tbody>
{(data && data.length > 0) ? data?.map((item, index) => (
<tr className="py-2 border-t border-dashed border-slate-300">
<td className="px-2 py-2">
<div className='w-full min-w-48 flex items-center gap-2 whitespace-nowrap'>
<img className="w-10 h-10 rounded-md" src={Avatar} alt="Jese image" />
<div className="text-left">
<div className="text-base font-semibold">{item?.name || ''}</div>
<div className="font-normal text-gray-500">{item?.bvn}</div>
</div>
</div>
</td>
<td className="px-2">
<div className="text-left">
<div className="font-normal text-gray-500">{item?.loan}</div>
</div>
</td>
<td className="px-2">
<div className="text-left">
<div className="font-normal text-gray-500">{item?.amount}</div>
</div>
</td>
<td className="px-2">
<div className="text-left">
<div className="font-normal text-gray-500">{getDateFromDateString(item?.added)} {getTimeFromDateString(item?.added)}</div>
</div>
</td>
<td className="px-2">
<div className="text-left">
{!item?.verified ? 'N/A' : `${getDateFromDateString(item?.verified)} ${getTimeFromDateString(item?.verified)}`}
</div>
</td>
<td className="px-2 text-right">
<div className='flex items-center justify-end gap-3 md:gap-4'>
<div className='p-2 flex justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'>
<Icons name='edit' />
</div>
<div className='p-2 flex justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'>
<Icons name='eye' />
</div>
<div className='hidden fle p-2 justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'>
<Icons name='trash' />
</div>
</div>
</td>
</tr>
))
:
<tr className="py-2 border-t border-dashed border-slate-300">
<td className="px-3 py-2" colSpan={4}>
<div className="flex justify-center items-center">
No Record Found
</div>
</td>
<td className="px-3 py-2">
<div className="flex items-center">
{!item?.verified ? 'N/A' : `${getDateFromDateString(item?.verified)} ${getTimeFromDateString(item?.verified)}`}
</div>
</td>
<td className="px-3 py-2 flex gap-3 md:gap-4">
{/* <!-- Modal toggle --> */}
{/* <Link to={RouteLinks.manageAdminPage}>
<i onClick={handleShowEditModal} className="fa-solid fa-eye text-base md:text-lg cursor-pointer p-2 text-sky-600"></i>
</Link> */}
{/* <i onClick={handleShowEditModal} className="fa-solid fa-pen-to-square text-base md:text-lg cursor-pointer p-2"></i> */}
{/* <i onClick={handleDeleteModal} className="fa-solid fa-trash text-base md:text-lg cursor-pointer p-2 text-red-500"></i> */}
<Icons name='edit' />
<Icons name='eye' />
<Icons name='trash' className={'hidden text-red-500'} />
</td>
</tr>
))
:
<tr className="w-3 p-3">
<td className="px-3 py-2" colSpan={6}>
<div className="flex justify-center items-center">
No Record Found
</div>
</td>
</tr>
}
</tbody>
</table>
</>
)}
</TableWrapper>
}
}
</tbody>
</table>
</>
)}
</TableWrapper>
}
</div>
</div>
)
}
@@ -25,83 +25,88 @@ export default function ApprovedLoanCom() {
<div className='w-full flex flex-col gap-8'>
<BreadcrumbCom title='Approved' paths={['Dashboard', 'Approved']} />
{isFetching ?
<>
<div className="w-full py-4">
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
{isFetching ?
<>
<p className='text-slate-800'>Loading...</p>
</div>
</>
: isError ?
<div className="w-full py-4">
</>
: isError ?
<p className='text-red-500'>{error.message}</p>
</div>
:
<TableWrapper data={approvedUsers} itemsPerPage={15}>
{({ data }) => (
<>
<table className="py-2 w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400">
<thead className="text-sm md:text-base text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400">
<tr>
<th scope="col" className="px-4 py-2">
Name
</th>
<th scope="col" className="px-4 py-2">
Loan
</th>
<th scope="col" className="px-4 py-2">
Added
</th>
<th scope="col" className="px-4 py-2">
Action
</th>
</tr>
</thead>
<tbody>
{(data && data.length > 0) ? data?.map((item, index) => (
<tr key={index} className="bg-white border-b dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600">
<th scope="row" className="mr-4 flex items-center px-3 py-2 text-gray-900 whitespace-nowrap dark:text-white">
<img className="w-10 h-10 rounded-full" src={Avatar} alt="Jese image" />
<div className="px-3">
<div className="text-base font-semibold">{item?.name || ''}</div>
<div className="font-normal text-gray-500">{item?.bvn}</div>
</div>
:
<TableWrapper data={approvedUsers} itemsPerPage={15}>
{({ data }) => (
<>
<table className="py-2 w-full text-sm">
<thead className="py-2 text-sm text-slate-500 text-left">
<tr>
<th scope="col" className="px-2 py-2">
Name
</th>
<td className="px-3 py-2">
{item?.loan} - {item?.description}
</td>
<td className="px-3 py-2">
<div className="flex items-center">
{getDateFromDateString(item?.added)} {getTimeFromDateString(item?.added)}
<th scope="col" className="px-2">
Loan
</th>
<th scope="col" className="px-2">
Added
</th>
<th scope="col" className="px-2 text-right">
Action
</th>
</tr>
</thead>
<tbody>
{(data && data.length > 0) ? data?.map((item, index) => (
<tr className="py-2 border-t border-dashed border-slate-300">
<td className="px-2 py-2">
<div className='w-full min-w-48 flex items-center gap-2 whitespace-nowrap'>
<img className="w-10 h-10 rounded-md" src={Avatar} alt="Jese image" />
<div className="text-left">
<div className="text-base font-semibold">{item?.name || ''}</div>
<div className="font-normal text-gray-500">{item?.bvn}</div>
</div>
</div>
</td>
<td className="px-2">
<div className="text-left">
<div className="text-base font-semibold">{item?.loan}</div>
<div className="font-normal text-gray-500">{item?.description}</div>
</div>
</td>
<td className="px-2">
<div className="text-left">
<div className="font-normal text-gray-500">{getDateFromDateString(item?.added)} {getTimeFromDateString(item?.added)}</div>
</div>
</td>
<td className="px-2 text-right">
<div className='flex items-center justify-end gap-3 md:gap-4'>
<div className='p-2 flex justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'>
<Icons name='edit' />
</div>
<div className='p-2 flex justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'>
<Icons name='eye' />
</div>
<div className='p-2 flex justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'>
<Icons name='trash' />
</div>
</div>
</td>
</tr>
))
:
<tr className="py-2 border-t border-dashed border-slate-300">
<td className="px-3 py-2" colSpan={4}>
<div className="flex justify-center items-center">
No Record Found
</div>
</td>
<td className="px-3 py-2 flex gap-3 md:gap-4">
{/* <!-- Modal toggle --> */}
{/* <Link to={RouteLinks.manageAdminPage}>
<i onClick={handleShowEditModal} className="fa-solid fa-eye text-base md:text-lg cursor-pointer p-2 text-sky-600"></i>
</Link> */}
{/* <i onClick={handleShowEditModal} className="fa-solid fa-pen-to-square text-base md:text-lg cursor-pointer p-2"></i> */}
{/* <i onClick={handleDeleteModal} className="fa-solid fa-trash text-base md:text-lg cursor-pointer p-2 text-red-500"></i> */}
<Icons name='edit' />
<Icons name='eye' />
<Icons name='trash' className={'hidden text-red-500'} />
</td>
</tr>
))
:
<tr className="w-3 p-3">
<td className="px-3 py-2" colSpan={4}>
<div className="flex justify-center items-center">
No Record Found
</div>
</td>
</tr>
}
</tbody>
</table>
</>
)}
</TableWrapper>
}
}
</tbody>
</table>
</>
)}
</TableWrapper>
}
</div>
</div>
)
}
+60 -39
View File
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react'
import { useDispatch } from 'react-redux'
import { useLocation, useNavigate } from 'react-router-dom'
import { useLocation, useNavigate, Link } from 'react-router-dom'
// import { useMutation } from '@tanstack/react-query'
import Label from '../Label'
@@ -12,6 +12,8 @@ import { updateUserDetails } from "../../store/UserDetails";
import GoogleDownload from '../../assets/download/andriod.jpg'
import IOSDownload from '../../assets/download/apple.jpg'
import RouteLinks from '../../RouteLinks'
import DummyLogo from '../DummyLogo'
import Icons from '../Icons'
export default function LoginCom() {
@@ -64,47 +66,66 @@ export default function LoginCom() {
return (
<>
<div className={`h-screen bg-sky-300 flex flex-col items-center bg-[url('./assets/login-bg.jpg')] bg-cover bg-center bg-no-repeat`}>
<div className='flex flex-col gap-3 w-[80%] sm:w-[500px] bg-white rounded-xl mt-8 p-8 shadow'>
<div className='w-full mb-8 flex flex-col gap-1'>
<h1 className='text-2xl md:text-3xl font-bold'>Digifi BackOffice</h1>
<p className='text-sm font-medium text-slate-400'>Welcome back, please login to your account</p>
</div>
<div className='text-input flex flex-col gap-2'>
<Label name='Username' htmlfor='username' />
<InputText id='username' name='username' value={fields.username} handleChange={handleChange} />
</div>
<div className='text-input flex flex-col gap-2'>
<Label name='Password' htmlfor='password' />
<InputText id='password' name='password' type='password' value={fields.password} handleChange={handleChange} />
</div>
{/* {login.error &&
<>
<div className="w-full text-center p-2">
<p className='text-red-500 text-sm'>{login.error.message}</p>
</div>
</>
} */}
<div className='mt-5 flex justify-end items-center'>
{/* <button onClick={()=>{login.mutate(fields)}} disabled={login.isPending} className='px-3 py-2 bg-purple-800 text-white font-bold rounded'>{login.isPending ? 'loading...' : 'Login'}</button> */}
<button onClick={handleLogin} className='px-4 py-[5px] bg-purple-600 text-white font-bold rounded'>{loading ? 'Loading...' : 'SIGN IN'}</button>
</div>
<div className="hidden mt-8 gri grid-cols-2 gap-8">
<div className="w-full">
<a className="icon google"
href='#' >
<img src={IOSDownload} className='w-100 h-auto' alt='IOS Download' />
</a>
<div className={`h-screen bg-sky-300 flex flex-col items-center justify-center bg-[url('./assets/login-bg.jpg')] bg-cover bg-center bg-no-repeat`}>
<div className='p-4 sm:p-8 w-full max-w-7xl mx-auto grid gap-8 grid-cols-1 md:grid-cols-3 lg:grid-cols-2'>
<div className='col-span-1 md:col-span-2 lg:col-span-1 h-full'>
<div className='flex flex-col gap-8 w-full bg-white rounded-xl p-16 sm:px-20 sm:py-16 shadow'>
<div className='w-full flex flex-col gap-1 items-center'>
<h1 className='text-2xl md:text-3xl font-bold text-black-body'>Sign In</h1>
<p className='text-sm font-medium text-slate-500'>Welcome back, please login to your account</p>
</div>
<div className="w-full">
<a className="icon apple" href='#'>
<img src={GoogleDownload} className='w-100 h-auto' alt='IOS Download' />
</a>
{/* social login */}
<div className='grid grid-cols-2 gap-4 text-sm'>
<div className='px-4 py-2 flex gap-2 items-center justify-center text-black-body font-medium border border-slate-300/50 rounded-md hover:text-primary hover:bg-sky-50 cursor-pointer'>
<Icons name='google' />
<span>Sign in with Google</span>
</div>
<div className='px-4 py-2 flex gap-2 items-center justify-center text-black-body font-medium border border-slate-300/50 rounded-md hover:text-primary hover:bg-sky-50 cursor-pointer'>
<Icons name='apple' />
<span>Sign in with Apple</span>
</div>
</div>
<div className='relative h-[1px] bg-slate-300/50'>
<p className='absolute left-1/2 -translate-x-1/2 top-1/2 -translate-y-1/2 bg-white p-4 text-12 text-slate-500'>Or with email</p>
</div>
<div className='flex flex-col gap-6'>
<div className='text-input flex flex-col gap-2'>
<InputText id='username' placeholder='Username' name='username' value={fields.username} handleChange={handleChange} />
</div>
<div className='text-input flex flex-col gap-2 mb-10'>
<InputText id='password' placeholder='Password' name='password' type='password' value={fields.password} handleChange={handleChange} />
{/* <p className='text-sm text-end font-medium text-primary'>Forget password ?</p> */}
</div>
<div className='h-10 mb-10'>
{/* <button onClick={()=>{login.mutate(fields)}} disabled={login.isPending} className='px-3 py-2 bg-purple-800 text-white font-bold rounded'>{login.isPending ? 'loading...' : 'Login'}</button> */}
<button onClick={handleLogin} className='w-full h-full bg-primary text-white font-bold rounded-md'>{loading ? 'Loading...' : 'Sign In'}</button>
</div>
</div>
{/* <p className='text-sm text-center font-medium text-slate-500'>Not yet a member? <span className='text-primary'>Sign Up</span></p> */}
<div className='flex justify-end gap-4 mt-6 text-[13px] font-medium'>
<Link className='text-primary' to=''>Terms</Link>
<Link className='text-primary' to=''>Plans</Link>
<Link className='text-primary' to=''>Contact Us</Link>
</div>
{/* {login.error &&
<>
<div className="w-full text-center p-2">
<p className='text-red-500 text-sm'>{login.error.message}</p>
</div>
</>
} */}
</div>
</div>
<div className='col-span-1 md:col-span-1 lg:col-span-1 h-full flex flex-col gap-3 justify-center items-center md:items-start'>
{/* <DummyLogo />
<p className='text-4xl text-black-body font-bold'>Dummy Text Here</p> */}
</div>
</div>
</div>
@@ -24,84 +24,88 @@ export default function DisbursementsLoanCom() {
return (
<div className='w-full flex flex-col gap-8'>
<BreadcrumbCom title='Disbursements' paths={['Dashboard', 'Disbursements']} />
{isFetching ?
<>
<div className="w-full py-4">
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
{isFetching ?
<>
<p className='text-slate-800'>Loading...</p>
</div>
</>
: isError ?
<div className="w-full py-4">
</>
: isError ?
<p className='text-red-500'>{error.message}</p>
</div>
:
<TableWrapper data={approvedUsers} itemsPerPage={15}>
{({ data }) => (
<>
<table className="py-2 w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400">
<thead className="text-sm md:text-base text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400">
<tr>
<th scope="col" className="px-4 py-2">
Name
</th>
<th scope="col" className="px-4 py-2">
Loan
</th>
<th scope="col" className="px-4 py-2">
Added
</th>
<th scope="col" className="px-4 py-2">
Action
</th>
</tr>
</thead>
<tbody>
{(data && data.length > 0) ? data?.map((item, index) => (
<tr key={index} className="bg-white border-b dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600">
<th scope="row" className="mr-4 flex items-center px-3 py-2 text-gray-900 whitespace-nowrap dark:text-white">
<img className="w-10 h-10 rounded-full" src={Avatar} alt="Jese image" />
<div className="px-3">
<div className="text-base font-semibold">{item?.name || ''}</div>
<div className="font-normal text-gray-500">{item?.bvn}</div>
</div>
:
<TableWrapper data={approvedUsers} itemsPerPage={15}>
{({ data }) => (
<>
<table className="py-2 w-full text-sm">
<thead className="py-2 text-sm text-slate-500 text-left">
<tr>
<th scope="col" className="px-2 py-2">
Name
</th>
<td className="px-3 py-2">
{item?.loan} - {item?.description}
</td>
<td className="px-3 py-2">
<div className="flex items-center">
{getDateFromDateString(item?.added)} {getTimeFromDateString(item?.added)}
<th scope="col" className="px-2">
Loan
</th>
<th scope="col" className="px-2">
Added
</th>
<th scope="col" className="px-2 text-right">
Action
</th>
</tr>
</thead>
<tbody>
{(data && data.length > 0) ? data?.map((item, index) => (
<tr className="py-2 border-t border-dashed border-slate-300">
<td className="px-2 py-2">
<div className='w-full min-w-48 flex items-center gap-2 whitespace-nowrap'>
<img className="w-10 h-10 rounded-md" src={Avatar} alt="Jese image" />
<div className="text-left">
<div className="text-base font-semibold">{item?.name || ''}</div>
<div className="font-normal text-gray-500">{item?.bvn}</div>
</div>
</div>
</td>
<td className="px-2">
<div className="text-left">
<div className="text-base font-semibold">{item?.loan}</div>
<div className="font-normal text-gray-500">{item?.description}</div>
</div>
</td>
<td className="px-2">
<div className="text-left">
<div className="font-normal text-gray-500">{getDateFromDateString(item?.added)} {getTimeFromDateString(item?.added)}</div>
</div>
</td>
<td className="px-2 text-right">
<div className='flex items-center justify-end gap-3 md:gap-4'>
<div className='p-2 flex justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'>
<Icons name='edit' />
</div>
<div className='p-2 flex justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'>
<Icons name='eye' />
</div>
<div className='hidden fle p-2 justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'>
<Icons name='trash' />
</div>
</div>
</td>
</tr>
))
:
<tr className="py-2 border-t border-dashed border-slate-300">
<td className="px-3 py-2" colSpan={4}>
<div className="flex justify-center items-center">
No Record Found
</div>
</td>
<td className="px-3 py-2 flex gap-3 md:gap-4">
{/* <!-- Modal toggle --> */}
{/* <Link to={RouteLinks.manageAdminPage}>
<i onClick={handleShowEditModal} className="fa-solid fa-eye text-base md:text-lg cursor-pointer p-2 text-sky-600"></i>
</Link> */}
{/* <i onClick={handleShowEditModal} className="fa-solid fa-pen-to-square text-base md:text-lg cursor-pointer p-2"></i> */}
{/* <i onClick={handleDeleteModal} className="fa-solid fa-trash text-base md:text-lg cursor-pointer p-2 text-red-500"></i> */}
<Icons name='edit' />
<Icons name='eye' />
<Icons name='trash' className={'hidden text-red-500'} />
</td>
</tr>
))
:
<tr className="w-3 p-3">
<td className="px-3 py-2" colSpan={4}>
<div className="flex justify-center items-center">
No Record Found
</div>
</td>
</tr>
}
</tbody>
</table>
</>
)}
</TableWrapper>
}
}
</tbody>
</table>
</>
)}
</TableWrapper>
}
</div>
</div>
)
}
+1 -1
View File
@@ -21,7 +21,7 @@ export default function LogoutModal({close}) {
return (
<ModalWrapper
>
<div className="relative bg-white rounded-lg shadow-round_black dark:shadow-round_white dark:bg-gray-700 dark:text-white">
<div className="relative bg-white-body rounded-lg shadow-round_black dark:border-[1px] dark:border-[#1E2027] dark:bg-black-box dark:text-white">
{/* <!-- Modal header --> */}
<div className="flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-gray-600">
<h3 className="text-xl font-semibold text-gray-900 dark:text-white">
+101 -95
View File
@@ -25,105 +25,111 @@ export default function ApplicationsLoanCom() {
return (
<div className='w-full flex flex-col gap-8'>
<BreadcrumbCom title='Loan offers' paths={['Dashboard', 'Loan offers']} />
{isFetching ?
<>
<div className="w-full py-4">
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
{isFetching ?
<>
<p className='text-slate-800'>Loading...</p>
</div>
</>
: isError ?
<div className="w-full py-4">
</>
: isError ?
<p className='text-red-500'>{error.message}</p>
</div>
:
<TableWrapper data={loanOffersUsersList} itemsPerPage={15}>
{({ data }) => (
<>
<table className="py-2 w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400">
<thead className="text-sm md:text-base text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400">
<tr>
<th scope="col" className="px-4 py-2">
CID
</th>
<th scope="col" className="px-4 py-2">
Loan
</th>
<th scope="col" className="px-4 py-2">
Amount
</th>
<th scope="col" className="px-4 py-2">
Description
</th>
<th scope="col" className="px-4 py-2">
Days Duration
</th>
<th scope="col" className="px-4 py-2">
Ative
</th>
<th scope="col" className="px-4 py-2">
Score
</th>
<th scope="col" className="px-4 py-2">
Lorder
</th>
{/* <th scope="col" className="px-4 py-2">
Action
</th> */}
</tr>
</thead>
<tbody>
{(data && data.length > 0) ? data?.map((item, index) => (
<tr key={index} className="bg-white border-b dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600">
<th scope="row" className="mr-4 flex items-center px-3 py-2 text-gray-900 whitespace-nowrap dark:text-white">
<img className="w-10 h-10 rounded-full" src={Avatar} alt="Jese image" />
<div className="px-3">
<div className="text-base font-semibold">{item?.cid}</div>
</div>
:
<TableWrapper data={loanOffersUsersList} itemsPerPage={15}>
{({ data }) => (
<>
<table className="py-2 w-full text-sm">
<thead className="py-2 text-sm text-slate-500 text-left">
<tr>
<th scope="col" className="px-2 py-2">
CID
</th>
<th scope="col" className="px-2">
Loan
</th>
<th scope="col" className="px-2">
Amount
</th>
<th scope="col" className="px-2">
Description
</th>
<th scope="col" className="px-2 text-right">
Days Duration
</th>
<th scope="col" className="px-2 text-right">
Active
</th>
<th scope="col" className="px-2 text-right">
Score
</th>
<th scope="col" className="px-2 text-right">
Lorder
</th>
<td className="px-3 py-2">
{item?.loan}
</td>
<td className="px-3 py-2">
{item?.amount || ''}
</td>
<td className="px-3 py-2">
{item?.description}
</td>
<td className="px-3 py-2">
{item?.days_duration}
</td>
<td className="px-3 py-2">
{item?.active}
</td>
<td className="px-3 py-2">
{item?.score}
</td>
<td className="px-3 py-2">
{item?.lorder}
</td>
{/* <td className="px-3 py-2 flex gap-3 md:gap-4">
<Icons name='edit' />
<Icons name='eye' />
<Icons name='trash' className={'hidden text-red-500'} />
</td> */}
</tr>
))
:
<tr className="w-3 p-3">
<td className="px-3 py-2" colSpan={8}>
<div className="flex justify-center items-center">
No Record Found
</div>
</td>
</tr>
}
</tbody>
</table>
</>
)}
</TableWrapper>
}
</thead>
<tbody>
{(data && data.length > 0) ? data?.map((item, index) => (
<tr className="py-2 border-t border-dashed border-slate-300">
<td className="px-2 py-2">
<div className='w-full min-w-48 flex items-center gap-2 whitespace-nowrap'>
<img className="w-10 h-10 rounded-md" src={Avatar} alt="Jese image" />
<div className="text-left">
<div className="text-base font-semibold">{item?.cid || ''}</div>
</div>
</div>
</td>
<td className="px-2">
<div className="text-left">
<div className="font-normal text-gray-500">{item?.loan}</div>
</div>
</td>
<td className="px-2">
<div className="text-left">
<div className="font-normal text-gray-500">{item?.amount}</div>
</div>
</td>
<td className="px-2">
<div className="text-left">
<div className="font-normal text-gray-500">{item?.description}</div>
</div>
</td>
<td className="px-2">
<div className="text-right">
<div className="font-normal text-gray-500">{item?.days_duration}</div>
</div>
</td>
<td className="px-2">
<div className="text-right">
<div className="font-normal text-gray-500">{item?.active}</div>
</div>
</td>
<td className="px-2">
<div className="text-right">
<div className="font-normal text-gray-500">{item?.score}</div>
</div>
</td>
<td className="px-2">
<div className="text-right">
<div className="font-normal text-gray-500">{item?.lorder}</div>
</div>
</td>
</tr>
))
:
<tr className="py-2 border-t border-dashed border-slate-300">
<td className="px-3 py-2" colSpan={4}>
<div className="flex justify-center items-center">
No Record Found
</div>
</td>
</tr>
}
</tbody>
</table>
</>
)}
</TableWrapper>
}
</div>
</div>
)
}
+1 -1
View File
@@ -1,7 +1,7 @@
export default function ModalWrapper({children, maxWidth}) {
return (
<div className="bg-gray-900/40 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-[999] flex flex-col justify-center items-center w-full md:inset-0 h-[calc(100%)] max-h-full">
<div className="bg-[rgba(0,_0,_0,_0.2)] dark:bg-[rgba(0,_0,_0,_0.4)] overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-[999] flex flex-col justify-center items-center w-full md:inset-0 h-[calc(100%)] max-h-full">
<div className={`pop-modal relative p-4 w-full ${maxWidth ? maxWidth : 'max-w-2xl'} max-h-full`}>
{/* <!-- Modal content --> */}
<div className="pb-4">