Merge pull request 'fix ux' (#16) from epic-6-snap-hybrid-complete into dev
Reviewed-on: #16
This commit is contained in:
commit
01179d646e
|
|
@ -1,9 +1,7 @@
|
|||
import React from 'react'
|
||||
import { useParams, useSearchParams } from 'react-router-dom'
|
||||
import { Alert } from '../components/alert/Alert'
|
||||
import { usePaymentNavigation } from '../features/payments/lib/navigation'
|
||||
import { usePaymentStatus } from '../features/payments/lib/usePaymentStatus'
|
||||
import { Env } from '../lib/env'
|
||||
import type { PaymentStatusResponse } from '../features/payments/lib/midtrans'
|
||||
import { Logger } from '../lib/logger'
|
||||
import { CountdownRedirect } from '../components/CountdownRedirect'
|
||||
|
|
@ -80,24 +78,6 @@ export function PaymentStatusPage() {
|
|||
}
|
||||
}, [isLoading, error, data])
|
||||
|
||||
function statusBadgeClass(s: PaymentStatusResponse['status']) {
|
||||
switch (s) {
|
||||
case 'pending':
|
||||
return 'inline-block rounded px-2 py-0.5 text-xs bg-yellow-100 text-yellow-800'
|
||||
case 'settlement':
|
||||
case 'capture':
|
||||
return 'inline-block rounded px-2 py-0.5 text-xs bg-green-100 text-green-800'
|
||||
case 'deny':
|
||||
case 'cancel':
|
||||
case 'expire':
|
||||
case 'refund':
|
||||
case 'chargeback':
|
||||
return 'inline-block rounded px-2 py-0.5 text-xs bg-red-100 text-red-800'
|
||||
default:
|
||||
return 'inline-block rounded px-2 py-0.5 text-xs bg-gray-100 text-gray-800'
|
||||
}
|
||||
}
|
||||
|
||||
// User-friendly status messages
|
||||
function getStatusMessage(s: PaymentStatusResponse['status']) {
|
||||
switch (s) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue