F
This commit is contained in:
@@ -120,15 +120,51 @@
|
||||
}
|
||||
|
||||
.status_cancelled {
|
||||
background: rgba(138, 138, 154, 0.18);
|
||||
color: #a0a0b0;
|
||||
}
|
||||
|
||||
.status_rejected {
|
||||
background: rgba(255, 77, 77, 0.15);
|
||||
color: #ff4d4d;
|
||||
}
|
||||
|
||||
.status_failed {
|
||||
.status_error {
|
||||
background: rgba(255, 140, 66, 0.15);
|
||||
color: #ff8c42;
|
||||
}
|
||||
|
||||
/* payment statuses */
|
||||
.status_money_accepted {
|
||||
background: rgba(74, 109, 255, 0.15);
|
||||
color: #4a6dff;
|
||||
}
|
||||
|
||||
.status_web3_processing {
|
||||
background: rgba(155, 109, 255, 0.15);
|
||||
color: #9b6dff;
|
||||
}
|
||||
|
||||
.status_web3_hash_error {
|
||||
background: rgba(255, 77, 77, 0.15);
|
||||
color: #ff4d4d;
|
||||
}
|
||||
|
||||
.status_web3_balance_problem {
|
||||
background: rgba(255, 140, 66, 0.15);
|
||||
color: #ff8c42;
|
||||
}
|
||||
|
||||
.status_receipt_error {
|
||||
background: rgba(255, 77, 77, 0.15);
|
||||
color: #ff4d4d;
|
||||
}
|
||||
|
||||
.status_usdt_delivered {
|
||||
background: rgba(0, 196, 140, 0.15);
|
||||
color: var(--success, #00c48c);
|
||||
}
|
||||
|
||||
/* ── Accordion item ── */
|
||||
.accordionItem {
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
|
||||
@@ -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