fix: clean unused variables and refine modal parameter binding
Some checks failed
Deploy Canina / deploy (push) Has been cancelled

This commit is contained in:
parsa aghaei 2026-08-23 11:16:32 +03:30
parent 7848232452
commit 26a992c030
2 changed files with 9 additions and 17 deletions

View File

@ -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 },
};
export const getPaymentStatusBadge = (status: string) => {
const getPaymentStatusBadge = (status: string) => {
switch (status?.toLowerCase()) {
case 'success':
case 'paid':
@ -132,7 +132,7 @@ export const getPaymentStatusBadge = (status: string) => {
}
};
export const getShippingMethodLabel = (method?: string) => {
const getShippingMethodLabel = (method?: string) => {
switch (method?.toLowerCase()) {
case 'express':
case 'tipax': return { label: 'تیپاکس (اکسپرس)', color: 'bg-purple-50 text-purple-700 border-purple-200' };
@ -144,7 +144,8 @@ export const getShippingMethodLabel = (method?: string) => {
}
};
export const getPaymentMethodLabel = (method?: string) => {
const getPaymentMethodLabel = (method?: string) => {
switch (method?.toLowerCase()) {
case 'online':
case 'zibal':
@ -158,6 +159,7 @@ export const getPaymentMethodLabel = (method?: string) => {
}
};
const toPersianDigits = (n: string | number): string => {
if (n === null || n === undefined) return '';
const farsiDigits = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹'];

View File

@ -2,28 +2,17 @@ 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,
@ -36,10 +25,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;
@ -953,15 +942,16 @@ export default function Transactions() {
{refundModalTx && (
<Modal
isOpen={!!refundModalTx}
onClose={() => setRefundModalTx(null)}
onClose={closeRefundModal}
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={() => setRefundModalTx(null)}>
<Button variant="outline" size="sm" onClick={closeRefundModal}>
انصراف
</Button>
<Button
variant={refundTarget === 'wallet' ? 'primary' : 'danger'}
size="sm"