fix parts
This commit is contained in:
@@ -44,7 +44,10 @@ export default function OffersCom() {
|
||||
<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">
|
||||
<th scope="col" className="px-1 py-1">
|
||||
ID
|
||||
</th>
|
||||
<th scope="col" className="px-1 py-1">
|
||||
Name
|
||||
</th>
|
||||
<th scope="col" className="px-2 text-right">
|
||||
@@ -53,9 +56,12 @@ export default function OffersCom() {
|
||||
<th scope="col" className="px-2 text-right">
|
||||
Insurance Rate
|
||||
</th>
|
||||
<th scope="col" className="px-2 text-right">
|
||||
<th scope="col" className="px-1 text-right">
|
||||
Mgt. Rate
|
||||
</th>
|
||||
<th scope="col" className="px-1 text-right">
|
||||
Vat. Rate
|
||||
</th>
|
||||
<th scope="col" className="px-2 text-right">
|
||||
Max/Min Amount
|
||||
</th>
|
||||
@@ -70,9 +76,14 @@ export default function OffersCom() {
|
||||
<tbody>
|
||||
{(data && data.length > 0) ? data?.map((item, index) => (
|
||||
<tr key={index} className="py-2 border-t border-dashed border-slate-300">
|
||||
<td className="px-2">
|
||||
<div className="text-right">
|
||||
<div className="font-normal text-gray-500">{item?.id || ''}</div>
|
||||
</div>
|
||||
</td>
|
||||
<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" />
|
||||
{/*<img className="w-10 h-10 rounded-md" src={Avatar} alt="Jese image" />*/}
|
||||
<div className="text-left">
|
||||
<div className="text-base font-semibold">{item?.product_id || ''}</div>
|
||||
{/* <div className="font-normal text-gray-500 line-clamp-1">{item?.description}</div> */}
|
||||
@@ -89,11 +100,16 @@ export default function OffersCom() {
|
||||
<div className="font-normal text-gray-500">{formatNumber(item?.insurance_rate)}</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-2">
|
||||
<td className="px-1">
|
||||
<div className="text-right">
|
||||
<div className="font-normal text-gray-500">{formatNumber(item?.management_rate)}</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-1">
|
||||
<div className="text-right">
|
||||
<div className="font-normal text-gray-500">{formatNumber(item?.vat_rate)}</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-2">
|
||||
<div className="text-right">
|
||||
<div className="font-normal text-gray-500">{formatNumber(item?.max_amount)}</div>
|
||||
|
||||
@@ -8,6 +8,7 @@ import queryKeys from '../../services/queryKeys'
|
||||
import {getLoans} from '../../services/siteServices'
|
||||
import getDateFromDateString from '../../helpers/GetDateFromDateString';
|
||||
import formatNumber from '../../helpers/formatNumber'
|
||||
import getTimeFromDateString from "../../helpers/GetTimeFromDateString";
|
||||
|
||||
export default function LoanDetails({transactionID}) {
|
||||
|
||||
@@ -53,86 +54,97 @@ export default function LoanDetails({transactionID}) {
|
||||
Added/Due
|
||||
</th>
|
||||
<th scope="col" className="px-2 text-right">
|
||||
Action
|
||||
Status
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{loans?.map((item, index) => (
|
||||
<tr key={index} 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?.account_id || ''}</div>
|
||||
<div
|
||||
className="font-normal text-gray-500">{item?.id} : {item?.transaction_id}</div>
|
||||
<div className="font-semibold text-red-500">ORIGIN
|
||||
: {item?.original_transaction}</div>
|
||||
<div className="font-bold text-blue-500">OFFER
|
||||
: {item?.offer_id}</div>
|
||||
<>
|
||||
<tr key={index} 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?.account_id || ''}</div>
|
||||
<div
|
||||
className="font-normal text-gray-500">{item?.id} : {item?.transaction_id}</div>
|
||||
<div className="font-semibold text-red-500">ORIGIN
|
||||
: {item?.original_transaction}</div>
|
||||
<div className="font-bold text-blue-500">OFFER
|
||||
: {item?.offer_id}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-2">
|
||||
<div className="text-right">
|
||||
{/* <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-red-500">{formatNumber(item?.eligible_amount)}</div>
|
||||
</td>
|
||||
<td className="px-2">
|
||||
<div className="text-right">
|
||||
{/* <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-red-500">{formatNumber(item?.eligible_amount)}</div>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-2">
|
||||
<div className="text-right">
|
||||
<div
|
||||
className="font-normal text-gray-500">{formatNumber(item?.product_id)}</div>
|
||||
<div className="font-normal text-gray-500">{item?.tenor} days</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-2">
|
||||
<div className="text-right">
|
||||
<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>
|
||||
</td>
|
||||
<td className="px-2">
|
||||
<div className="text-right">
|
||||
<div
|
||||
className="font-normal text-gray-500">{getDateFromDateString(item?.created_at)}</div>
|
||||
<div
|
||||
className="font-semibold text-red-500">{getDateFromDateString(item?.due_date)}</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='eye'/>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</td>
|
||||
<td className="px-2">
|
||||
<div className="text-right">
|
||||
<div
|
||||
className="font-normal text-gray-500">{formatNumber(item?.product_id)}</div>
|
||||
<div className="font-normal text-gray-500">{item?.tenor} days</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-2">
|
||||
<div className="text-right">
|
||||
<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>
|
||||
</td>
|
||||
<td className="px-2">
|
||||
<div className="text-right">
|
||||
<div
|
||||
className="font-normal text-gray-500">{getDateFromDateString(item?.created_at)}</div>
|
||||
<div
|
||||
className="font-semibold text-red-500">{getDateFromDateString(item?.due_date)}</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-2 text-right">
|
||||
<div className="font-semibold text-red-500">{item?.status}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colSpan="8">
|
||||
<div>
|
||||
<p className='pb-4 font-bold text-base'>Loans Disbursement
|
||||
Details</p>
|
||||
<div className="font-bold text-blue-500">Disburse Date
|
||||
: {getDateFromDateString(item?.disburseDate)} {getTimeFromDateString(item?.disburseDate)} </div>
|
||||
<div className="font-bold text-gray-500">Disburse Description
|
||||
: {item?.disburseDescription}</div>
|
||||
<div className="font-bold text-red-500">Disburse Result
|
||||
: {item?.disburseResult}</div>
|
||||
<div><br/></div>
|
||||
<div className="font-bold text-blue-500">Disburse Verify
|
||||
Date: {getDateFromDateString(item?.disburseVerify)} {getTimeFromDateString(item?.disburseVerify)} </div>
|
||||
<div className="font-bold text-gray-500">Verify Description
|
||||
: {item?.verifyDescription}</div>
|
||||
<div className="font-bold text-red-500">Verify Result
|
||||
: {item?.verifyResult}</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</>
|
||||
|
||||
|
||||
))
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
<div>
|
||||
<p className='pb-4 font-bold text-base'>Loans Disbursement Details</p>
|
||||
<div className="font-bold text-blue-500">Disburse Date : {item?.disburseDate}</div>
|
||||
<div className="font-bold text-gray-500">Disburse Description
|
||||
: {item?.disburseDescription}</div>
|
||||
<div className="font-bold text-red-500">Disburse Result : {item?.disburseResult}</div>
|
||||
<div><br/></div>
|
||||
<div className="font-bold text-blue-500">Disburse Verify DAte: {item?.disburseVerify}</div>
|
||||
<div className="font-bold text-gray-500">Verify Description
|
||||
: {item?.verifyDescription}</div>
|
||||
<div className="font-bold text-red-500">Verify Result : {item?.verifyResult}</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
:
|
||||
null
|
||||
|
||||
@@ -43,10 +43,10 @@ export default function TransactionDetails({transactionID}) {
|
||||
Account
|
||||
</th>
|
||||
<th scope="col" className="px-2">
|
||||
Activity
|
||||
Customer
|
||||
</th>
|
||||
<th scope="col" className="px-2 text-right">
|
||||
Action
|
||||
Channel
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -70,18 +70,11 @@ export default function TransactionDetails({transactionID}) {
|
||||
</td>
|
||||
<td className="px-2">
|
||||
<div className="text-left">
|
||||
<div className="font-normal text-gray-500">50%</div>
|
||||
<div className="relative h-[6px] w-full bg-white-body dark:bg-black-body rounded-full overflow-hidden">
|
||||
<div className={`absolute left-0 h-full w-1/2 bg-emerald-600`}></div>
|
||||
</div>
|
||||
<div className="text-base font-semibold">{item?.customer_id}</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='eye' />
|
||||
</div>
|
||||
</div>
|
||||
<div className="text-base font-semibold">{item?.channel}</div>
|
||||
</td>
|
||||
</tr>
|
||||
))
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
function getDateFromDateString(dateString) {
|
||||
const date = new Date(dateString);
|
||||
|
||||
|
||||
if (dateString == null || dateString.trim() === '' ) return '';
|
||||
|
||||
// Ensure the date is valid
|
||||
if (isNaN(date)) {
|
||||
return "Invalid date string";
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
function getTimeFromDateString(dateString) {
|
||||
const date = new Date(dateString);
|
||||
|
||||
|
||||
if (dateString == null || dateString.trim() === '' ) return '';
|
||||
|
||||
// Ensure the date is valid
|
||||
if (isNaN(date)) {
|
||||
return "Invalid date string";
|
||||
|
||||
Reference in New Issue
Block a user