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