Compare commits

...

1 Commits

Author SHA1 Message Date
victorAnumudu 6b883c35eb updated some tables 2025-04-10 10:06:53 +01:00
4 changed files with 344 additions and 323 deletions
@@ -26,97 +26,103 @@ export default function LoanOffersCom() {
<div className='w-full flex flex-col gap-8'> <div className='w-full flex flex-col gap-8'>
<BreadcrumbCom title='Applications' paths={['Dashboard', 'Applications']} /> <BreadcrumbCom title='Applications' paths={['Dashboard', 'Applications']} />
{isFetching ? <div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
<> {isFetching ?
<div className="w-full py-4"> <>
<p className='text-slate-800'>Loading...</p> <p className='text-slate-800'>Loading...</p>
</div> </>
</> : isError ?
: isError ?
<div className="w-full py-4">
<p className='text-red-500'>{error.message}</p> <p className='text-red-500'>{error.message}</p>
</div> :
: <TableWrapper data={appliedUsers} itemsPerPage={15}>
<TableWrapper data={appliedUsers} itemsPerPage={15}> {({ data }) => (
{({ data }) => ( <>
<> <table className="py-2 w-full text-sm">
<table className="py-2 w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400"> <thead className="py-2 text-sm text-slate-500 text-left">
<thead className="text-sm md:text-base text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400"> <tr>
<tr> <th scope="col" className="px-2 py-2">
<th scope="col" className="px-4 py-2"> Name
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>
</th> </th>
<td className="px-3 py-2"> <th scope="col" className="px-2">
{item?.loan} - {item?.description} Loan
</td> </th>
<td className="px-3 py-2"> <th scope="col" className="px-2">
{item?.amount || ''} Amount
</td> </th>
<td className="px-3 py-2"> <th scope="col" className="px-2">
<div className="flex items-center"> Added
{getDateFromDateString(item?.added)} {getTimeFromDateString(item?.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> </div>
</td> </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>
)) }
: </tbody>
<tr className="w-3 p-3"> </table>
<td className="px-3 py-2" colSpan={6}> </>
<div className="flex justify-center items-center"> )}
No Record Found </TableWrapper>
</div> }
</td> </div>
</tr>
}
</tbody>
</table>
</>
)}
</TableWrapper>
}
</div> </div>
) )
} }
@@ -25,83 +25,88 @@ export default function ApprovedLoanCom() {
<div className='w-full flex flex-col gap-8'> <div className='w-full flex flex-col gap-8'>
<BreadcrumbCom title='Approved' paths={['Dashboard', 'Approved']} /> <BreadcrumbCom title='Approved' paths={['Dashboard', 'Approved']} />
{isFetching ? <div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
<> {isFetching ?
<div className="w-full py-4"> <>
<p className='text-slate-800'>Loading...</p> <p className='text-slate-800'>Loading...</p>
</div> </>
</> : isError ?
: isError ?
<div className="w-full py-4">
<p className='text-red-500'>{error.message}</p> <p className='text-red-500'>{error.message}</p>
</div> :
: <TableWrapper data={approvedUsers} itemsPerPage={15}>
<TableWrapper data={approvedUsers} itemsPerPage={15}> {({ data }) => (
{({ data }) => ( <>
<> <table className="py-2 w-full text-sm">
<table className="py-2 w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400"> <thead className="py-2 text-sm text-slate-500 text-left">
<thead className="text-sm md:text-base text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400"> <tr>
<tr> <th scope="col" className="px-2 py-2">
<th scope="col" className="px-4 py-2"> Name
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>
</th> </th>
<td className="px-3 py-2"> <th scope="col" className="px-2">
{item?.loan} - {item?.description} Loan
</td> </th>
<td className="px-3 py-2"> <th scope="col" className="px-2">
<div className="flex items-center"> Added
{getDateFromDateString(item?.added)} {getTimeFromDateString(item?.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> </div>
</td> </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>
)) }
: </tbody>
<tr className="w-3 p-3"> </table>
<td className="px-3 py-2" colSpan={4}> </>
<div className="flex justify-center items-center"> )}
No Record Found </TableWrapper>
</div> }
</td> </div>
</tr>
}
</tbody>
</table>
</>
)}
</TableWrapper>
}
</div> </div>
) )
} }
@@ -24,84 +24,88 @@ export default function DisbursementsLoanCom() {
return ( return (
<div className='w-full flex flex-col gap-8'> <div className='w-full flex flex-col gap-8'>
<BreadcrumbCom title='Disbursements' paths={['Dashboard', 'Disbursements']} /> <BreadcrumbCom title='Disbursements' paths={['Dashboard', 'Disbursements']} />
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
{isFetching ? {isFetching ?
<> <>
<div className="w-full py-4">
<p className='text-slate-800'>Loading...</p> <p className='text-slate-800'>Loading...</p>
</div> </>
</> : isError ?
: isError ?
<div className="w-full py-4">
<p className='text-red-500'>{error.message}</p> <p className='text-red-500'>{error.message}</p>
</div> :
: <TableWrapper data={approvedUsers} itemsPerPage={15}>
<TableWrapper data={approvedUsers} itemsPerPage={15}> {({ data }) => (
{({ data }) => ( <>
<> <table className="py-2 w-full text-sm">
<table className="py-2 w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400"> <thead className="py-2 text-sm text-slate-500 text-left">
<thead className="text-sm md:text-base text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400"> <tr>
<tr> <th scope="col" className="px-2 py-2">
<th scope="col" className="px-4 py-2"> Name
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>
</th> </th>
<td className="px-3 py-2"> <th scope="col" className="px-2">
{item?.loan} - {item?.description} Loan
</td> </th>
<td className="px-3 py-2"> <th scope="col" className="px-2">
<div className="flex items-center"> Added
{getDateFromDateString(item?.added)} {getTimeFromDateString(item?.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> </div>
</td> </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>
)) }
: </tbody>
<tr className="w-3 p-3"> </table>
<td className="px-3 py-2" colSpan={4}> </>
<div className="flex justify-center items-center"> )}
No Record Found </TableWrapper>
</div> }
</td> </div>
</tr>
}
</tbody>
</table>
</>
)}
</TableWrapper>
}
</div> </div>
) )
} }
+101 -95
View File
@@ -25,105 +25,111 @@ export default function ApplicationsLoanCom() {
return ( return (
<div className='w-full flex flex-col gap-8'> <div className='w-full flex flex-col gap-8'>
<BreadcrumbCom title='Loan offers' paths={['Dashboard', 'Loan offers']} /> <BreadcrumbCom title='Loan offers' paths={['Dashboard', 'Loan offers']} />
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
{isFetching ? {isFetching ?
<> <>
<div className="w-full py-4">
<p className='text-slate-800'>Loading...</p> <p className='text-slate-800'>Loading...</p>
</div> </>
</> : isError ?
: isError ?
<div className="w-full py-4">
<p className='text-red-500'>{error.message}</p> <p className='text-red-500'>{error.message}</p>
</div> :
: <TableWrapper data={loanOffersUsersList} itemsPerPage={15}>
<TableWrapper data={loanOffersUsersList} itemsPerPage={15}> {({ data }) => (
{({ data }) => ( <>
<> <table className="py-2 w-full text-sm">
<table className="py-2 w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400"> <thead className="py-2 text-sm text-slate-500 text-left">
<thead className="text-sm md:text-base text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400"> <tr>
<tr> <th scope="col" className="px-2 py-2">
<th scope="col" className="px-4 py-2"> CID
CID </th>
</th> <th scope="col" className="px-2">
<th scope="col" className="px-4 py-2"> Loan
Loan </th>
</th> <th scope="col" className="px-2">
<th scope="col" className="px-4 py-2"> Amount
Amount </th>
</th> <th scope="col" className="px-2">
<th scope="col" className="px-4 py-2"> Description
Description </th>
</th> <th scope="col" className="px-2 text-right">
<th scope="col" className="px-4 py-2"> Days Duration
Days Duration </th>
</th> <th scope="col" className="px-2 text-right">
<th scope="col" className="px-4 py-2"> Active
Ative </th>
</th> <th scope="col" className="px-2 text-right">
<th scope="col" className="px-4 py-2"> Score
Score </th>
</th> <th scope="col" className="px-2 text-right">
<th scope="col" className="px-4 py-2"> Lorder
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>
</th> </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>
)) </thead>
: <tbody>
<tr className="w-3 p-3"> {(data && data.length > 0) ? data?.map((item, index) => (
<td className="px-3 py-2" colSpan={8}> <tr className="py-2 border-t border-dashed border-slate-300">
<div className="flex justify-center items-center"> <td className="px-2 py-2">
No Record Found <div className='w-full min-w-48 flex items-center gap-2 whitespace-nowrap'>
</div> <img className="w-10 h-10 rounded-md" src={Avatar} alt="Jese image" />
</td> <div className="text-left">
</tr> <div className="text-base font-semibold">{item?.cid || ''}</div>
} </div>
</tbody> </div>
</table> </td>
</> <td className="px-2">
)} <div className="text-left">
</TableWrapper> <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> </div>
) )
} }