diff --git a/assets/admin/pages/SmsWalletPage.tsx b/assets/admin/pages/SmsWalletPage.tsx index 6b4ae0f9..84c58e54 100644 --- a/assets/admin/pages/SmsWalletPage.tsx +++ b/assets/admin/pages/SmsWalletPage.tsx @@ -6,6 +6,7 @@ import { z } from 'zod'; import { toast } from 'sonner'; import { ArrowUpCircleIcon, ArrowDownCircleIcon, DevicePhoneMobileIcon, + ClockIcon, CheckCircleIcon, XCircleIcon, BellAlertIcon, ChatBubbleLeftEllipsisIcon, } from '@heroicons/react/24/outline'; import { api } from '../lib/api'; import type { ApiResponse, PaginatedResponse } from '../lib/api'; @@ -82,23 +83,19 @@ function SmsWalletPageInner() { <> -
+ {/* ردیف بالا: موجودی + آمار */} +
{/* کارت موجودی — gradient */}
- {/* دایره تزئینی */}
-
موجودی کیف پول
- - {balanceLoading ? ( -
- ) : ( + {balanceLoading ?
: ( <> -
+
{formatRial(balance?.balance_rials ?? 0)}
معادل {formatNumber(smsCount)} پیامک {balance?.sms_price_rials ? ` (هر پیامک ${formatRial(balance.sms_price_rials)})` : ''}
- - {/* نوار پیشرفت */} -
+
-
- {/* تنظیمات پیامک */} -
-
- - تنظیمات ارسال + {/* آمار پیامک */} +
+
+
+ +
+
+
{formatNumber(smsCount)}
+
پیامک باقی‌مانده
+
-
- {currentSettings ? ( -
- {/* toggle یادآوری */} -
+
+ +
+
+
+ {currentSettings?.reminder_enabled ? `${currentSettings.reminder_hours_before} ساعت` : '—'} +
+
یادآوری قبل از نوبت
+
+
+
+ + {/* وضعیت سرویس */} +
+
وضعیت سرویس‌ها
+ {[ + { label: 'یادآوری نوبت', on: currentSettings?.reminder_enabled ?? false }, + { label: 'پیامک بعد از ویزیت', on: currentSettings?.post_visit_enabled ?? false }, + ].map(({ label, on }) => ( +
+ {label} + + {on ? 'فعال' : 'غیرفعال'} + +
+ ))} +
+
+ + {/* تنظیمات ارسال — full width */} +
+
+ + تنظیمات ارسال پیامک +
+
+ {currentSettings ? ( +
+ + {/* ردیف: یادآوری قبل از نوبت */} +
+
+
+ +
+
+
یادآوری قبل از نوبت
+
پیامک یادآور به بیمار چند ساعت قبل از وقت نوبت ارسال می‌شود
+ {currentSettings.reminder_enabled && ( +
+ + setLocalSettings({ ...currentSettings, reminder_hours_before: +e.target.value })} + dir="ltr" + style={{ width: 72, textAlign: 'center' }} + /> + +
+ )} +
+
+
setLocalSettings({ ...currentSettings, reminder_enabled: !currentSettings.reminder_enabled })} - > - setLocalSettings({ ...currentSettings, reminder_enabled: e.target.checked })} - style={{ width: 16, height: 16, accentColor: 'var(--primary)', marginTop: 2, cursor: 'pointer', flexShrink: 0 }} - onClick={(e) => e.stopPropagation()} - /> -
-
یادآوری قبل از نوبت
-
ارسال خودکار چند ساعت قبل از نوبت
-
-
+ /> +
- {currentSettings.reminder_enabled && ( -
- - setLocalSettings({ ...currentSettings, reminder_hours_before: +e.target.value })} - dir="ltr" - style={{ width: 90 }} - /> -
- )} - - {/* toggle بعد از ویزیت */} -
setLocalSettings({ ...currentSettings, post_visit_enabled: !currentSettings.post_visit_enabled })} - > - setLocalSettings({ ...currentSettings, post_visit_enabled: e.target.checked })} - style={{ width: 16, height: 16, accentColor: 'var(--primary)', marginTop: 2, cursor: 'pointer', flexShrink: 0 }} - onClick={(e) => e.stopPropagation()} - /> -
-
پیامک بعد از ویزیت
-
ارسال متن تشکر پس از پایان مراجعه
+ {/* ردیف: پیامک بعد از ویزیت */} +
+ {/* header ردیف */} +
+
+
+ +
+
+
پیامک بعد از ویزیت
+
متن تشکر پس از پایان مراجعه برای بیمار ارسال می‌شود
+
+
setLocalSettings({ ...currentSettings, post_visit_enabled: !currentSettings.post_visit_enabled })} + />
+ {/* محتوای باز‌شونده */} {currentSettings.post_visit_enabled && ( -
-
- +
+
+
متن پیامک