Loan details updates
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
@@ -6,7 +6,7 @@ import Icons from '../Icons'
|
|||||||
import {getLoanCharges} from '../../services/siteServices'
|
import {getLoanCharges} from '../../services/siteServices'
|
||||||
import getDateFromDateString from '../../helpers/GetDateFromDateString';
|
import getDateFromDateString from '../../helpers/GetDateFromDateString';
|
||||||
import formatNumber from '../../helpers/formatNumber'
|
import formatNumber from '../../helpers/formatNumber'
|
||||||
import Avatar from '../../assets/user_avatar.jpg'
|
import Avatar from '../../assets/repay.png'
|
||||||
|
|
||||||
|
|
||||||
export default function LoansChargesCom() {
|
export default function LoansChargesCom() {
|
||||||
@@ -55,7 +55,7 @@ export default function LoansChargesCom() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='w-full flex flex-col gap-8'>
|
<div className='w-full flex flex-col gap-8'>
|
||||||
<BreadcrumbCom title='Transactions' paths={['Dashboard', 'Transactions']} />
|
<BreadcrumbCom title='Charges' paths={['Dashboard', 'Charges']}/>
|
||||||
|
|
||||||
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
|
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
|
||||||
{isError ?
|
{isError ?
|
||||||
@@ -66,27 +66,33 @@ export default function LoansChargesCom() {
|
|||||||
<div className='px-2 py-2 mb-4 flex flex-col sm:flex-row flex-wrap sm:items-center gap-2'>
|
<div className='px-2 py-2 mb-4 flex flex-col sm:flex-row flex-wrap sm:items-center gap-2'>
|
||||||
<Icons name='filter' className='text-3xl'/>
|
<Icons name='filter' className='text-3xl'/>
|
||||||
<div className='w-full sm:max-w-48'>
|
<div className='w-full sm:max-w-48'>
|
||||||
<select name='type' value={filter?.type} className='h-10 w-full p-2 rounded-md' onChange={handleFilter}>
|
<select name='type' value={filter?.type} className='h-10 w-full p-2 rounded-md'
|
||||||
|
onChange={handleFilter}>
|
||||||
<option value=''>All</option>
|
<option value=''>All</option>
|
||||||
<option value='transaction_id'>Transaction ID</option>
|
<option value='transaction_id'>Transaction ID</option>
|
||||||
<option value='account_id'>Account ID</option>
|
<option value='account_id'>Account ID</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div className='w-full sm:max-w-48'>
|
<div className='w-full sm:max-w-48'>
|
||||||
<input name='id' value={filter?.id} disabled={!filter.type} className={`h-10 w-full p-2 rounded-md outline-none border border-black-aside ${!filter.type && 'opacity-30'}`} onChange={handleFilter} />
|
<input name='id' value={filter?.id} disabled={!filter.type}
|
||||||
|
className={`h-10 w-full p-2 rounded-md outline-none border border-black-aside ${!filter.type && 'opacity-30'}`}
|
||||||
|
onChange={handleFilter}/>
|
||||||
</div>
|
</div>
|
||||||
<button onClick={handleFilterByParams} disabled={filter.type && !filter.id} className={`h-10 bg-primary px-2 py-1 rounded-md text-white font-medium sm:self-end ${(filter.type && !filter.id) && 'opacity-50'}`}>Submit</button>
|
<button onClick={handleFilterByParams} disabled={filter.type && !filter.id}
|
||||||
|
className={`h-10 bg-primary px-2 py-1 rounded-md text-white font-medium sm:self-end ${(filter.type && !filter.id) && 'opacity-50'}`}>Submit
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{/* end of filter section */}
|
{/* end of filter section */}
|
||||||
|
|
||||||
<TablePaginatedWrapper data={loanCharges} isFetching={isFetching} setPage={setPage} itemsPerPage={pagination?.limit} pagination={pagination}>
|
<TablePaginatedWrapper data={loanCharges} isFetching={isFetching} setPage={setPage}
|
||||||
|
itemsPerPage={pagination?.limit} pagination={pagination}>
|
||||||
{({data}) => (
|
{({data}) => (
|
||||||
<>
|
<>
|
||||||
<table className="py-2 w-full text-sm">
|
<table className="py-2 w-full text-sm">
|
||||||
<thead className="py-2 text-sm text-slate-500 text-left">
|
<thead className="py-2 text-sm text-slate-500 text-left">
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col" className="px-2 py-2">
|
<th scope="col" className="px-2 py-2">
|
||||||
Name
|
TransactionID/Fee Type
|
||||||
</th>
|
</th>
|
||||||
{/* <th scope="col" className="px-2">
|
{/* <th scope="col" className="px-2">
|
||||||
Loan
|
Loan
|
||||||
@@ -106,28 +112,35 @@ export default function LoansChargesCom() {
|
|||||||
{(data && data.length > 0) ? data?.map((item, index) => (
|
{(data && data.length > 0) ? data?.map((item, index) => (
|
||||||
<tr key={index} className="py-2 border-t border-dashed border-slate-300">
|
<tr key={index} className="py-2 border-t border-dashed border-slate-300">
|
||||||
<td className="px-2 py-2">
|
<td className="px-2 py-2">
|
||||||
<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" />
|
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-left">
|
||||||
<div className="text-base font-semibold">{item?.transaction_id || ''}</div>
|
<div
|
||||||
<div className="font-normal text-gray-500 line-clamp-1">{item?.code}</div>
|
className="text-base font-semibold">{item?.transaction_id || ''}</div>
|
||||||
|
<div
|
||||||
|
className="font-normal text-gray-500 line-clamp-1">{item?.code}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-2">
|
<td className="px-2">
|
||||||
<div className="text-right">
|
<div className="text-right">
|
||||||
{/* <div className="text-base font-semibold">{formatNumber(item?.initial_loan_amount)}</div> */}
|
{/* <div className="text-base font-semibold">{formatNumber(item?.initial_loan_amount)}</div> */}
|
||||||
<div className="font-normal text-gray-500">{formatNumber(item?.amount)}</div>
|
<div
|
||||||
|
className="font-semibold text-green-500">#{formatNumber(item?.amount)}</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-2">
|
<td className="px-2">
|
||||||
<div className="text-right">
|
<div className="text-right">
|
||||||
<div className="font-normal text-gray-500">{getDateFromDateString(item?.created_at)}</div>
|
<div
|
||||||
|
className="font-normal text-gray-500">{getDateFromDateString(item?.created_at)}</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-2 text-right">
|
<td className="px-2 text-right">
|
||||||
<div className='flex items-center justify-end gap-3 md:gap-4'>
|
<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'>
|
<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'/>
|
<Icons name='eye'/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import TablePaginatedWrapper from '../tableWrapper/TablePaginatedWrapper'
|
|||||||
import Icons from '../Icons'
|
import Icons from '../Icons'
|
||||||
import {getLoans} from '../../services/siteServices'
|
import {getLoans} from '../../services/siteServices'
|
||||||
import getDateFromDateString from '../../helpers/GetDateFromDateString';
|
import getDateFromDateString from '../../helpers/GetDateFromDateString';
|
||||||
import Avatar from '../../assets/user_avatar.jpg'
|
import Avatar from '../../assets/loans.png'
|
||||||
import RouteLinks from '../../RouteLinks';
|
import RouteLinks from '../../RouteLinks';
|
||||||
import formatNumber from '../../helpers/formatNumber'
|
import formatNumber from '../../helpers/formatNumber'
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ export default function LoansCom() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='w-full flex flex-col gap-8'>
|
<div className='w-full flex flex-col gap-8'>
|
||||||
<BreadcrumbCom title='Transactions' paths={['Dashboard', 'Transactions']} />
|
<BreadcrumbCom title='Loans' paths={['Dashboard', 'Loans']}/>
|
||||||
|
|
||||||
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
|
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
|
||||||
{isError ?
|
{isError ?
|
||||||
@@ -67,20 +67,26 @@ export default function LoansCom() {
|
|||||||
<div className='px-2 py-2 mb-4 flex flex-col sm:flex-row flex-wrap sm:items-center gap-2'>
|
<div className='px-2 py-2 mb-4 flex flex-col sm:flex-row flex-wrap sm:items-center gap-2'>
|
||||||
<Icons name='filter' className='text-3xl'/>
|
<Icons name='filter' className='text-3xl'/>
|
||||||
<div className='w-full sm:max-w-48'>
|
<div className='w-full sm:max-w-48'>
|
||||||
<select name='type' value={filter?.type} className='h-10 w-full p-2 rounded-md' onChange={handleFilter}>
|
<select name='type' value={filter?.type} className='h-10 w-full p-2 rounded-md'
|
||||||
|
onChange={handleFilter}>
|
||||||
<option value=''>All</option>
|
<option value=''>All</option>
|
||||||
<option value='transaction_id'>Transaction ID</option>
|
<option value='transaction_id'>Transaction ID</option>
|
||||||
<option value='account_id'>Account ID</option>
|
<option value='account_id'>Account ID</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div className='w-full sm:max-w-48'>
|
<div className='w-full sm:max-w-48'>
|
||||||
<input name='id' value={filter?.id} disabled={!filter.type} className={`h-10 w-full p-2 rounded-md outline-none border border-black-aside ${!filter.type && 'opacity-30'}`} onChange={handleFilter} />
|
<input name='id' value={filter?.id} disabled={!filter.type}
|
||||||
|
className={`h-10 w-full p-2 rounded-md outline-none border border-black-aside ${!filter.type && 'opacity-30'}`}
|
||||||
|
onChange={handleFilter}/>
|
||||||
</div>
|
</div>
|
||||||
<button onClick={handleFilterByParams} disabled={filter.type && !filter.id} className={`h-10 bg-primary px-2 py-1 rounded-md text-white font-medium sm:self-end ${(filter.type && !filter.id) && 'opacity-50'}`}>Submit</button>
|
<button onClick={handleFilterByParams} disabled={filter.type && !filter.id}
|
||||||
|
className={`h-10 bg-primary px-2 py-1 rounded-md text-white font-medium sm:self-end ${(filter.type && !filter.id) && 'opacity-50'}`}>Submit
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{/* end of filter section */}
|
{/* end of filter section */}
|
||||||
|
|
||||||
<TablePaginatedWrapper data={loans} isFetching={isFetching} setPage={setPage} itemsPerPage={pagination?.limit} pagination={pagination}>
|
<TablePaginatedWrapper data={loans} isFetching={isFetching} setPage={setPage}
|
||||||
|
itemsPerPage={pagination?.limit} pagination={pagination}>
|
||||||
{({data}) => (
|
{({data}) => (
|
||||||
<>
|
<>
|
||||||
<table className="table-auto py-2 w-full text-sm">
|
<table className="table-auto py-2 w-full text-sm">
|
||||||
@@ -110,41 +116,53 @@ export default function LoansCom() {
|
|||||||
{(data && data.length > 0) ? data?.map((item, index) => (
|
{(data && data.length > 0) ? data?.map((item, index) => (
|
||||||
<tr key={index} className="py-2 border-t border-dashed border-slate-300">
|
<tr key={index} className="py-2 border-t border-dashed border-slate-300">
|
||||||
<td className="px-2 py-2">
|
<td className="px-2 py-2">
|
||||||
<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" />
|
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-left">
|
||||||
<div className="text-base font-semibold">{item?.account_id || ''}</div>
|
<div
|
||||||
<div className="font-normal text-gray-500">{item?.id} : {item?.transaction_id}</div>
|
className="text-base font-semibold">{item?.account_id || ''}</div>
|
||||||
|
<div
|
||||||
|
className="font-normal text-gray-500">{item?.id} : {item?.transaction_id}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-2">
|
<td className="px-2">
|
||||||
<div className="text-right">
|
<div className="text-right">
|
||||||
{/* <div className="text-base font-semibold">{formatNumber(item?.initial_loan_amount)}</div> */}
|
{/* <div className="text-base font-semibold">{formatNumber(item?.initial_loan_amount)}</div> */}
|
||||||
<div className="font-normal text-gray-500">{formatNumber(item?.initial_loan_amount)}</div>
|
<div
|
||||||
|
className="font-semibold text-green-500">#{formatNumber(item?.initial_loan_amount)}</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-2">
|
<td className="px-2">
|
||||||
<div className="text-right">
|
<div className="text-right">
|
||||||
<div className="font-normal text-gray-500">{formatNumber(item?.product_id)}</div>
|
<div
|
||||||
<div className="font-normal text-gray-500">{item?.tenor} days</div>
|
className="font-normal text-gray-500">{formatNumber(item?.product_id)}</div>
|
||||||
|
<div className="font-normal text-red-500">{item?.tenor} days
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-2">
|
<td className="px-2">
|
||||||
<div className="text-right">
|
<div className="text-right">
|
||||||
<div className="font-normal text-gray-500">{formatNumber(item?.repayment_amount)}</div>
|
<div
|
||||||
<div className="font-normal text-gray-500">{formatNumber(item?.installment_amount)}</div>
|
className="font-normal text-gray-500">{formatNumber(item?.repayment_amount)}</div>
|
||||||
|
<div
|
||||||
|
className="font-normal text-gray-500">{formatNumber(item?.installment_amount)}</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-2">
|
<td className="px-2">
|
||||||
<div className="text-right">
|
<div className="text-right">
|
||||||
<div className="font-normal text-gray-500">{getDateFromDateString(item?.created_at)}</div>
|
<div
|
||||||
|
className="font-normal text-gray-500">{getDateFromDateString(item?.created_at)}</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-2 text-right">
|
<td className="px-2 text-right">
|
||||||
<div className='flex items-center justify-end gap-3 md:gap-4'>
|
<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'>
|
<div
|
||||||
<Link to={RouteLinks.transaction_details_page} state={{transactionID: item?.transaction_id}}>
|
className='p-2 flex justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'>
|
||||||
|
<Link to={RouteLinks.transaction_details_page}
|
||||||
|
state={{transactionID: item?.transaction_id}}>
|
||||||
<Icons name='eye'/>
|
<Icons name='eye'/>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import TablePaginatedWrapper from '../tableWrapper/TablePaginatedWrapper'
|
|||||||
import Icons from '../Icons'
|
import Icons from '../Icons'
|
||||||
import {getRepayments} from '../../services/siteServices'
|
import {getRepayments} from '../../services/siteServices'
|
||||||
import getDateFromDateString from '../../helpers/GetDateFromDateString';
|
import getDateFromDateString from '../../helpers/GetDateFromDateString';
|
||||||
import Avatar from '../../assets/user_avatar.jpg'
|
import Avatar from '../../assets/loans2.png';
|
||||||
|
|
||||||
|
|
||||||
export default function RepaymentsCom() {
|
export default function RepaymentsCom() {
|
||||||
@@ -54,7 +54,7 @@ export default function RepaymentsCom() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='w-full flex flex-col gap-8'>
|
<div className='w-full flex flex-col gap-8'>
|
||||||
<BreadcrumbCom title='Transactions' paths={['Dashboard', 'Transactions']} />
|
<BreadcrumbCom title='Repayments' paths={['Dashboard', 'Repayments']}/>
|
||||||
|
|
||||||
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
|
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
|
||||||
{isError ?
|
{isError ?
|
||||||
@@ -65,27 +65,33 @@ export default function RepaymentsCom() {
|
|||||||
<div className='px-2 py-2 mb-4 flex flex-col sm:flex-row flex-wrap sm:items-center gap-2'>
|
<div className='px-2 py-2 mb-4 flex flex-col sm:flex-row flex-wrap sm:items-center gap-2'>
|
||||||
<Icons name='filter' className='text-3xl'/>
|
<Icons name='filter' className='text-3xl'/>
|
||||||
<div className='w-full sm:max-w-48'>
|
<div className='w-full sm:max-w-48'>
|
||||||
<select name='type' value={filter?.type} className='h-10 w-full p-2 rounded-md' onChange={handleFilter}>
|
<select name='type' value={filter?.type} className='h-10 w-full p-2 rounded-md'
|
||||||
|
onChange={handleFilter}>
|
||||||
<option value=''>All</option>
|
<option value=''>All</option>
|
||||||
<option value='transaction_id'>Transaction ID</option>
|
<option value='transaction_id'>Transaction ID</option>
|
||||||
<option value='account_id'>Account ID</option>
|
<option value='account_id'>Account ID</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div className='w-full sm:max-w-48'>
|
<div className='w-full sm:max-w-48'>
|
||||||
<input name='id' value={filter?.id} disabled={!filter.type} className={`h-10 w-full p-2 rounded-md outline-none border border-black-aside ${!filter.type && 'opacity-30'}`} onChange={handleFilter} />
|
<input name='id' value={filter?.id} disabled={!filter.type}
|
||||||
|
className={`h-10 w-full p-2 rounded-md outline-none border border-black-aside ${!filter.type && 'opacity-30'}`}
|
||||||
|
onChange={handleFilter}/>
|
||||||
</div>
|
</div>
|
||||||
<button onClick={handleFilterByParams} disabled={filter.type && !filter.id} className={`h-10 bg-primary px-2 py-1 rounded-md text-white font-medium sm:self-end ${(filter.type && !filter.id) && 'opacity-50'}`}>Submit</button>
|
<button onClick={handleFilterByParams} disabled={filter.type && !filter.id}
|
||||||
|
className={`h-10 bg-primary px-2 py-1 rounded-md text-white font-medium sm:self-end ${(filter.type && !filter.id) && 'opacity-50'}`}>Submit
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{/* end of filter section */}
|
{/* end of filter section */}
|
||||||
|
|
||||||
<TablePaginatedWrapper data={repayments} isFetching={isFetching} setPage={setPage} itemsPerPage={pagination?.limit} pagination={pagination}>
|
<TablePaginatedWrapper data={repayments} isFetching={isFetching} setPage={setPage}
|
||||||
|
itemsPerPage={pagination?.limit} pagination={pagination}>
|
||||||
{({data}) => (
|
{({data}) => (
|
||||||
<>
|
<>
|
||||||
<table className="py-2 w-full text-sm">
|
<table className="py-2 w-full text-sm">
|
||||||
<thead className="py-2 text-sm text-slate-500 text-left">
|
<thead className="py-2 text-sm text-slate-500 text-left">
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col" className="px-2 py-2">
|
<th scope="col" className="px-2 py-2">
|
||||||
Name
|
CustomerID / ID:TrxID
|
||||||
</th>
|
</th>
|
||||||
{/* <th scope="col" className="px-2">
|
{/* <th scope="col" className="px-2">
|
||||||
Loan
|
Loan
|
||||||
@@ -102,11 +108,16 @@ export default function RepaymentsCom() {
|
|||||||
{(data && data.length > 0) ? data?.map((item, index) => (
|
{(data && data.length > 0) ? data?.map((item, index) => (
|
||||||
<tr key={index} className="py-2 border-t border-dashed border-slate-300">
|
<tr key={index} className="py-2 border-t border-dashed border-slate-300">
|
||||||
<td className="px-2 py-2">
|
<td className="px-2 py-2">
|
||||||
<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" />
|
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-left">
|
||||||
<div className="text-base font-semibold">{item?.customer_id || ''}</div>
|
<div
|
||||||
<div className="font-normal text-gray-500">{item?.loan_id} : {item?.transaction_id}</div>
|
className="text-base font-semibold">{item?.customer_id || ''}</div>
|
||||||
|
<div
|
||||||
|
className="font-normal text-blue-500">{item?.loan_id} :<b> {item?.transaction_id}</b>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@@ -118,12 +129,14 @@ export default function RepaymentsCom() {
|
|||||||
</td> */}
|
</td> */}
|
||||||
<td className="px-2">
|
<td className="px-2">
|
||||||
<div className="text-left">
|
<div className="text-left">
|
||||||
<div className="font-normal text-gray-500">{getDateFromDateString(item?.created_at)}</div>
|
<div
|
||||||
|
className="font-normal text-gray-500">{getDateFromDateString(item?.created_at)}</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-2 text-right">
|
<td className="px-2 text-right">
|
||||||
<div className='flex items-center justify-end gap-3 md:gap-4'>
|
<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'>
|
<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'/>
|
<Icons name='eye'/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {useQuery} from "@tanstack/react-query";
|
|||||||
|
|
||||||
import Icons from '../Icons'
|
import Icons from '../Icons'
|
||||||
|
|
||||||
import Avatar from '../../assets/user_avatar.jpg'
|
import Avatar from '../../assets/loans.png'
|
||||||
import queryKeys from '../../services/queryKeys'
|
import queryKeys from '../../services/queryKeys'
|
||||||
import {getLoans} from '../../services/siteServices'
|
import {getLoans} from '../../services/siteServices'
|
||||||
import getDateFromDateString from '../../helpers/GetDateFromDateString';
|
import getDateFromDateString from '../../helpers/GetDateFromDateString';
|
||||||
|
|||||||
@@ -67,20 +67,26 @@ export default function TransactionsCom() {
|
|||||||
<div className='px-2 py-2 mb-4 flex flex-col sm:flex-row flex-wrap sm:items-center gap-2'>
|
<div className='px-2 py-2 mb-4 flex flex-col sm:flex-row flex-wrap sm:items-center gap-2'>
|
||||||
<Icons name='filter' className='text-3xl'/>
|
<Icons name='filter' className='text-3xl'/>
|
||||||
<div className='w-full sm:max-w-48'>
|
<div className='w-full sm:max-w-48'>
|
||||||
<select name='type' value={filter?.type} className='h-10 w-full p-2 rounded-md' onChange={handleFilter}>
|
<select name='type' value={filter?.type} className='h-10 w-full p-2 rounded-md'
|
||||||
|
onChange={handleFilter}>
|
||||||
<option value=''>All</option>
|
<option value=''>All</option>
|
||||||
<option value='transaction_id'>Transaction ID</option>
|
<option value='transaction_id'>Transaction ID</option>
|
||||||
<option value='account_id'>Account ID</option>
|
<option value='account_id'>Account ID</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div className='w-full sm:max-w-48'>
|
<div className='w-full sm:max-w-48'>
|
||||||
<input name='id' value={filter?.id} disabled={!filter.type} className={`h-10 w-full p-2 rounded-md outline-none border border-black-aside ${!filter.type && 'opacity-30'}`} onChange={handleFilter} />
|
<input name='id' value={filter?.id} disabled={!filter.type}
|
||||||
|
className={`h-10 w-full p-2 rounded-md outline-none border border-black-aside ${!filter.type && 'opacity-30'}`}
|
||||||
|
onChange={handleFilter}/>
|
||||||
</div>
|
</div>
|
||||||
<button onClick={handleFilterByParams} disabled={filter.type && !filter.id} className={`h-10 bg-primary px-2 py-1 rounded-md text-white font-medium sm:self-end ${(filter.type && !filter.id) && 'opacity-50'}`}>Submit</button>
|
<button onClick={handleFilterByParams} disabled={filter.type && !filter.id}
|
||||||
|
className={`h-10 bg-primary px-2 py-1 rounded-md text-white font-medium sm:self-end ${(filter.type && !filter.id) && 'opacity-50'}`}>Submit
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{/* end of filter section */}
|
{/* end of filter section */}
|
||||||
|
|
||||||
<TablePaginatedWrapper data={transactions} isFetching={isFetching} setPage={setPage} itemsPerPage={pagination?.limit} pagination={pagination}>
|
<TablePaginatedWrapper data={transactions} isFetching={isFetching} setPage={setPage}
|
||||||
|
itemsPerPage={pagination?.limit} pagination={pagination}>
|
||||||
{({data}) => (
|
{({data}) => (
|
||||||
<>
|
<>
|
||||||
<table className="py-2 w-full text-sm">
|
<table className="py-2 w-full text-sm">
|
||||||
@@ -93,7 +99,7 @@ export default function TransactionsCom() {
|
|||||||
Account
|
Account
|
||||||
</th>
|
</th>
|
||||||
<th scope="col" className="px-2">
|
<th scope="col" className="px-2">
|
||||||
Activity
|
Customer/ID
|
||||||
</th>
|
</th>
|
||||||
<th scope="col" className="px-2 text-right">
|
<th scope="col" className="px-2 text-right">
|
||||||
Action
|
Action
|
||||||
@@ -104,32 +110,38 @@ export default function TransactionsCom() {
|
|||||||
{(data && data.length > 0) ? data?.map((item, index) => (
|
{(data && data.length > 0) ? data?.map((item, index) => (
|
||||||
<tr key={index} className="py-2 border-t border-dashed border-slate-300">
|
<tr key={index} className="py-2 border-t border-dashed border-slate-300">
|
||||||
<td className="px-2 py-2">
|
<td className="px-2 py-2">
|
||||||
<div className='w-full min-w-48 flex items-center gap-2 whitespace-nowrap'>
|
<div
|
||||||
<img className="w-10 h-10 rounded-md" src={localImgLoader(`loan_icons/${item?.type}.png`)} alt="Icon" />
|
className='w-full min-w-48 flex items-center gap-2 whitespace-nowrap'>
|
||||||
|
<img className="w-10 h-10 rounded-md"
|
||||||
|
src={localImgLoader(`loan_icons/${item?.type}.png`)}
|
||||||
|
alt="Icon"/>
|
||||||
<div className="text-left">
|
<div className="text-left">
|
||||||
<div className="text-base font-semibold">{item?.transaction_id}</div>
|
<div
|
||||||
<div className="font-normal text-gray-500">{getDateFromDateString(item?.created_at)} {getTimeFromDateString(item?.created_at)}</div>
|
className="text-base font-semibold">{item?.transaction_id}</div>
|
||||||
|
<div
|
||||||
|
className="font-normal text-gray-500">{getDateFromDateString(item?.created_at)} {getTimeFromDateString(item?.created_at)}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-2">
|
<td className="px-2">
|
||||||
<div className="text-left">
|
<div className="text-left">
|
||||||
<div className="text-base font-semibold">{item?.account_id}</div>
|
<div
|
||||||
|
className="text-base font-semibold">{item?.account_id}</div>
|
||||||
<div className="font-normal text-gray-500">{item?.type}</div>
|
<div className="font-normal text-gray-500">{item?.type}</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-2">
|
<td className="px-2">
|
||||||
<div className="text-left">
|
<div className="text-left">
|
||||||
<div className="font-normal text-gray-500">50%</div>
|
<div className="text-base font-semibold">{item?.customer_id}</div>
|
||||||
<div className="relative h-[6px] w-full bg-white-body dark:bg-black-body rounded-full overflow-hidden">
|
<div className="font-normal text-red-500"><b>ID:</b>{item?.id}</div>
|
||||||
<div className={`absolute left-0 h-full w-1/2 bg-emerald-600`}></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-2 text-right">
|
<td className="px-2 text-right">
|
||||||
<div className='flex items-center justify-end gap-3 md:gap-4'>
|
<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'>
|
<div
|
||||||
<Link to={RouteLinks.transaction_details_page} state={{transactionID: item?.transaction_id}}>
|
className='p-2 flex justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'>
|
||||||
|
<Link to={RouteLinks.transaction_details_page}
|
||||||
|
state={{transactionID: item?.transaction_id}}>
|
||||||
<Icons name='eye'/>
|
<Icons name='eye'/>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user