From 330d960502e50a3acfd4b3c7d72d05ca200f906e Mon Sep 17 00:00:00 2001 From: parsa aghaei Date: Sat, 5 Sep 2026 15:40:03 +0330 Subject: [PATCH] fix(admin): resolve TypeScript errors and unused variables in SmsSettingsPage --- .../admin-panel/src/pages/SmsSettingsPage.tsx | 37 ++++++++----------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/frontend/admin-panel/src/pages/SmsSettingsPage.tsx b/frontend/admin-panel/src/pages/SmsSettingsPage.tsx index c594a2c..59eb89b 100644 --- a/frontend/admin-panel/src/pages/SmsSettingsPage.tsx +++ b/frontend/admin-panel/src/pages/SmsSettingsPage.tsx @@ -8,12 +8,10 @@ import { Coins, User, Hash, - HelpCircle, CheckCircle2, AlertCircle, Eye, EyeOff, - Sparkles, Smartphone, Plus, RefreshCw, @@ -30,7 +28,6 @@ import { Search, Trash2, TrendingUp, - RotateCcw, Info, ChevronLeft, ChevronRight, @@ -432,7 +429,7 @@ export default function SmsSettingsPage() { setRuleFormVariables(rule.variables ? [...rule.variables] : []); setRuleFormDescription(rule.description ? `${rule.description} (رونوشت)` : ''); setIsRuleModalOpen(true); - toast.info('اطلاعات سناریو تکثیر شد. پس از بازبینی، ذخیره نمایید.'); + toast('اطلاعات سناریو تکثیر شد. پس از بازبینی، ذخیره نمایید.', { icon: '📋' }); }; const handleSaveRule = async (e: React.FormEvent) => { @@ -617,22 +614,6 @@ export default function SmsSettingsPage() { } }; - const handleAssignPattern = async (type: keyof SmsConfigState, patternId: number) => { - const updated = { ...config, [type]: String(patternId) }; - setConfig(updated); - - try { - await api.patch('/settings/sms', { - ...updated, - [type]: Number(patternId), - }); - toast.success(`الگوی ${patternId} به عنوان رویداد مورد نظر تنظیم شد`); - refreshPatterns(); - } catch { - toast.error('خطا در ذخیره اتصال پترن'); - } - }; - const handleDeleteLog = async (id: string) => { if (!window.confirm('آیا از حذف این لاگ پیامک اطمینان دارید؟')) return; try { @@ -1221,6 +1202,18 @@ export default function SmsSettingsPage() { /> +
+ + setTestArg2(e.target.value)} + placeholder="150000" + className="w-full border border-gray-200 rounded-xl p-2.5 outline-none focus:ring-2 focus:ring-blue-500 text-xs font-mono font-bold" + dir="ltr" + /> +
+ {testResult && (
handleOpenAddRuleModal()} className="bg-amber-600 hover:bg-amber-700 text-white text-xs font-bold py-3 px-5 rounded-xl transition-all flex items-center gap-2 shadow-md shadow-amber-200 shrink-0" > @@ -1289,7 +1282,7 @@ export default function SmsSettingsPage() {