F
This commit is contained in:
@@ -2,21 +2,26 @@ import { useState } from 'react'
|
||||
import { WalletHeader } from '@widgets/wallet-header'
|
||||
import { Footer } from '@widgets/footer'
|
||||
import { useOrders } from '@features/payment'
|
||||
import type { OrderWithPayment, OrderStatus } from '@features/payment'
|
||||
import type { OrderWithPayment, OrderStatus, PaymentStatus } from '@features/payment'
|
||||
import styles from './TransactionsPage.module.css'
|
||||
|
||||
const ORDER_STATUS_LABELS: Record<OrderStatus, string> = {
|
||||
pending: 'Ожидание',
|
||||
completed: 'Выполнена',
|
||||
cancelled: 'Отменена',
|
||||
failed: 'Ошибка',
|
||||
rejected: 'Отклонён',
|
||||
completed: 'Выполнен',
|
||||
cancelled: 'Отменён',
|
||||
error: 'Ошибка',
|
||||
}
|
||||
|
||||
const PAYMENT_STATUS_LABELS: Record<OrderStatus, string> = {
|
||||
const PAYMENT_STATUS_LABELS: Record<PaymentStatus, string> = {
|
||||
pending: 'Ожидание',
|
||||
completed: 'Оплачен',
|
||||
cancelled: 'Отменён',
|
||||
failed: 'Ошибка',
|
||||
money_accepted: 'Деньги получены',
|
||||
web3_processing: 'Обработка в сети',
|
||||
web3_hash_error: 'Ошибка хэша',
|
||||
web3_balance_problem: 'Проблема с балансом',
|
||||
receipt_error: 'Ошибка чека',
|
||||
completed: 'Завершён',
|
||||
usdt_delivered: 'USDT отправлен',
|
||||
}
|
||||
|
||||
function formatDate(iso: string) {
|
||||
@@ -36,9 +41,9 @@ function truncateHash(hash: string) {
|
||||
return `${hash.slice(0, 8)}…${hash.slice(-6)}`
|
||||
}
|
||||
|
||||
function StatusBadge({ status, labels }: { status: OrderStatus; labels: Record<OrderStatus, string> }) {
|
||||
function StatusBadge({ status, labels }: { status: string; labels: Record<string, string> }) {
|
||||
return (
|
||||
<span className={`${styles.statusBadge} ${styles[`status_${status}`]}`}>
|
||||
<span className={`${styles.statusBadge} ${styles[`status_${status}`] ?? ''}`}>
|
||||
{labels[status] ?? status}
|
||||
</span>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user