Compare commits
No commits in common. "26a992c0303c320f9007b6f1b7eb01987f047b58" and "b2b80849ea99eae2f0dd20fbe703bd2292cb5191" have entirely different histories.
26a992c030
...
b2b80849ea
@ -115,7 +115,7 @@ export const ORDER_STATUS_MAP: Record<string, { label: string; color: string; ic
|
||||
cancelled: { label: 'لغو شده', color: 'bg-red-50 text-red-700 border-red-200', icon: XCircle },
|
||||
};
|
||||
|
||||
const getPaymentStatusBadge = (status: string) => {
|
||||
export const getPaymentStatusBadge = (status: string) => {
|
||||
switch (status?.toLowerCase()) {
|
||||
case 'success':
|
||||
case 'paid':
|
||||
@ -132,7 +132,7 @@ const getPaymentStatusBadge = (status: string) => {
|
||||
}
|
||||
};
|
||||
|
||||
const getShippingMethodLabel = (method?: string) => {
|
||||
export const getShippingMethodLabel = (method?: string) => {
|
||||
switch (method?.toLowerCase()) {
|
||||
case 'express':
|
||||
case 'tipax': return { label: 'تیپاکس (اکسپرس)', color: 'bg-purple-50 text-purple-700 border-purple-200' };
|
||||
@ -144,8 +144,7 @@ const getShippingMethodLabel = (method?: string) => {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const getPaymentMethodLabel = (method?: string) => {
|
||||
export const getPaymentMethodLabel = (method?: string) => {
|
||||
switch (method?.toLowerCase()) {
|
||||
case 'online':
|
||||
case 'zibal':
|
||||
@ -159,7 +158,6 @@ const getPaymentMethodLabel = (method?: string) => {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const toPersianDigits = (n: string | number): string => {
|
||||
if (n === null || n === undefined) return '';
|
||||
const farsiDigits = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹'];
|
||||
|
||||
@ -2,17 +2,28 @@ import React, { useState, useEffect, useCallback } from 'react';
|
||||
import {
|
||||
CreditCard,
|
||||
Search,
|
||||
RefreshCw,
|
||||
Eye,
|
||||
Copy,
|
||||
CheckCircle2,
|
||||
XCircle,
|
||||
Clock,
|
||||
Filter,
|
||||
DollarSign,
|
||||
TrendingUp,
|
||||
AlertTriangle,
|
||||
Receipt,
|
||||
User,
|
||||
ShoppingBag,
|
||||
ArrowUpDown,
|
||||
ExternalLink,
|
||||
ShieldCheck,
|
||||
RotateCcw,
|
||||
Activity,
|
||||
Globe,
|
||||
Monitor,
|
||||
Code,
|
||||
Send,
|
||||
Undo2,
|
||||
Printer,
|
||||
Wallet,
|
||||
@ -25,10 +36,10 @@ import Button from '../components/ui/Button';
|
||||
import Badge from '../components/ui/Badge';
|
||||
import ThSort from '../components/ui/ThSort';
|
||||
import Modal from '../components/ui/Modal';
|
||||
import MaskableField from '../components/ui/MaskableField';
|
||||
import TransactionReceiptModal, { type TransactionReceiptData } from '../components/TransactionReceiptModal';
|
||||
import { useTableParams } from '../utils/useTableParams';
|
||||
|
||||
|
||||
interface Transaction {
|
||||
id: string;
|
||||
userId: string;
|
||||
@ -99,7 +110,6 @@ export default function Transactions() {
|
||||
sortOrder,
|
||||
page,
|
||||
setParam,
|
||||
setMultipleParams,
|
||||
handleSort,
|
||||
clearFilters,
|
||||
} = useTableParams({
|
||||
@ -109,7 +119,6 @@ export default function Transactions() {
|
||||
defaultLimit: 15,
|
||||
});
|
||||
|
||||
|
||||
const [transactions, setTransactions] = useState<Transaction[]>([]);
|
||||
const [stats, setStats] = useState<Stats | null>(null);
|
||||
const [health, setHealth] = useState<GatewayHealth | null>(null);
|
||||
@ -942,16 +951,15 @@ export default function Transactions() {
|
||||
{refundModalTx && (
|
||||
<Modal
|
||||
isOpen={!!refundModalTx}
|
||||
onClose={closeRefundModal}
|
||||
onClose={() => setRefundModalTx(null)}
|
||||
title={`استرداد وجه تراکنش #${refundModalTx.trackId || refundModalTx.id.slice(0, 8)}`}
|
||||
icon={Undo2}
|
||||
maxWidth="lg"
|
||||
footer={
|
||||
<div className="flex items-center justify-end gap-2 w-full">
|
||||
<Button variant="outline" size="sm" onClick={closeRefundModal}>
|
||||
<Button variant="outline" size="sm" onClick={() => setRefundModalTx(null)}>
|
||||
انصراف
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
variant={refundTarget === 'wallet' ? 'primary' : 'danger'}
|
||||
size="sm"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user