This commit is contained in:
wayanrivan
2025-05-23 16:23:03 +07:00
parent 70912352fd
commit 6eb71d51ff
2 changed files with 21 additions and 28 deletions

View File

@ -322,7 +322,7 @@ const DetailApprovalTransaction = () => {
kind = 'CASHBACK CASH';
} else if (transactionDetails?.kind === 'H') {
kind = 'CASHBACK POINT';
}else if (transactionDetails?.kind === 'J') {
} else if (transactionDetails?.kind === 'J') {
kind = 'WITHDRAW ADMIN';
}
@ -550,7 +550,7 @@ const DetailApprovalTransaction = () => {
kind = 'CASHBACK CASH';
} else if (transactionDetails?.kind === 'H') {
kind = 'CASHBACK POINT';
}else if (transactionDetails?.kind === 'J') {
} else if (transactionDetails?.kind === 'J') {
kind = 'WITHDRAW ADMIN';
}
@ -874,8 +874,9 @@ const DetailApprovalTransaction = () => {
</tr>
</thead>
<tbody>
{transactionDetails?.log_approve && transactionDetails?.log_approve.length > 0 ? (
transactionDetails.log_approve.map((log: { created_at: string; status: string; updated_at: string }, index: number) => (
{[...transactionDetails.log_approve]
.sort((a, b) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime())
.map((log: { created_at: string; status: string; updated_at: string }, index: number) => (
<tr key={index} className="border-t">
<td className="px-4 py-2 font-medium">
{(() => {
@ -888,13 +889,15 @@ const DetailApprovalTransaction = () => {
status = 'REJECT';
} else if (log.status === 'T') {
status = 'NO NEED';
} else {
status = log.status || 'UNKNOWN';
}
return status;
})()}
</td>
<td className="px-4 py-2 text-sm text-gray-500">
{new Date(log.created_at).toLocaleString('sv-SE', {
timeZone: 'Asia/Jakarta', // kalau kamu mau waktu lokal (optional)
timeZone: 'Asia/Jakarta',
year: 'numeric',
month: '2-digit',
day: '2-digit',
@ -902,18 +905,11 @@ const DetailApprovalTransaction = () => {
minute: '2-digit',
second: '2-digit',
hour12: false,
}).replace(' ', ' ')}
})}
</td>
{/* <td className="px-4 py-2 text-sm text-gray-500">{log.updated_at}</td> */}
</tr>
))
) : (
<tr>
<td colSpan={3} className="px-4 py-2 text-center text-sm text-gray-500">
No logs available
</td>
</tr>
)}
))}
</tbody>
</table>
</div>
@ -921,6 +917,7 @@ const DetailApprovalTransaction = () => {
</div>
)}
{activeTab === 'p24' && (
<div className="space-y-4">
<h3 className="font-semibold">P24 Logs</h3>

View File

@ -472,7 +472,7 @@ const DetailTransaction = () => {
kind = 'CASHBACK CASH';
} else if (transactionDetails?.kind === 'H') {
kind = 'CASHBACK POINT';
}else if (transactionDetails?.kind === 'J') {
} else if (transactionDetails?.kind === 'J') {
kind = 'WITHDRAW ADMIN';
}
@ -617,7 +617,7 @@ const DetailTransaction = () => {
kind = 'CASHBACK CASH';
} else if (transactionDetails?.kind === 'H') {
kind = 'CASHBACK POINT';
}else if (transactionDetails?.kind === 'J') {
} else if (transactionDetails?.kind === 'J') {
kind = 'WITHDRAW ADMIN';
}
@ -946,8 +946,9 @@ const DetailTransaction = () => {
</tr>
</thead>
<tbody>
{transactionDetails?.log_approve && transactionDetails?.log_approve.length > 0 ? (
transactionDetails.log_approve.map((log: { created_at: string; status: string; updated_at: string }, index: number) => (
{[...transactionDetails.log_approve]
.sort((a, b) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime())
.map((log: { created_at: string; status: string; updated_at: string }, index: number) => (
<tr key={index} className="border-t">
<td className="px-4 py-2 font-medium">
{(() => {
@ -960,13 +961,15 @@ const DetailTransaction = () => {
status = 'REJECT';
} else if (log.status === 'T') {
status = 'NO NEED';
} else {
status = log.status || 'UNKNOWN';
}
return status;
})()}
</td>
<td className="px-4 py-2 text-sm text-gray-500">
{new Date(log.created_at).toLocaleString('sv-SE', {
timeZone: 'Asia/Jakarta', // kalau kamu mau waktu lokal (optional)
timeZone: 'Asia/Jakarta',
year: 'numeric',
month: '2-digit',
day: '2-digit',
@ -974,18 +977,11 @@ const DetailTransaction = () => {
minute: '2-digit',
second: '2-digit',
hour12: false,
}).replace(' ', ' ')}
})}
</td>
{/* <td className="px-4 py-2 text-sm text-gray-500">{log.updated_at}</td> */}
</tr>
))
) : (
<tr>
<td colSpan={3} className="px-4 py-2 text-center text-sm text-gray-500">
No logs available
</td>
</tr>
)}
))}
</tbody>
</table>
</div>