diff --git a/app/(dashboard)/support-tickets/[id]/page.tsx b/app/(dashboard)/support-tickets/[id]/page.tsx index f42fa89..7c646ad 100644 --- a/app/(dashboard)/support-tickets/[id]/page.tsx +++ b/app/(dashboard)/support-tickets/[id]/page.tsx @@ -7,6 +7,7 @@ import PageNavbar from '@/components/layouts/PageNavbar' import Button from '@/components/formElements/Button' import Input from '@/components/formElements/Input' import { APP_ROUTES } from '@/constants/routes' +import useAlertModal from '@/hooks/useAlertModal' import { addToast } from '@/lib/toast' import { formatIranianMobile, formatPersianDate } from '@/lib/formatters' import { @@ -21,6 +22,7 @@ import { const AdminSupportTicketDetail = () => { const { id } = useParams<{ id: string }>() + const { showAlert } = useAlertModal() const [ticket, setTicket] = useState(null) const [reply, setReply] = useState('') const [pending, setPending] = useState(false) @@ -56,6 +58,17 @@ const AdminSupportTicketDetail = () => { } } + const confirmClose = () => { + showAlert( + 'این تیکت بسته شود؟ کاربر دیگر نمی‌تواند پیام بفرستد و در صورت بستن توسط ادمین، خودش نمی‌تواند دوباره باز کند.', + () => { + void changeStatus('closed') + }, + undefined, + { dangerAccept: true } + ) + } + return (
@@ -104,6 +117,24 @@ const AdminSupportTicketDetail = () => { + {ticket.status !== 'closed' ? ( +
+ +
+ ) : ( +

+ {ticket.closedBy === 'user' + ? 'این تیکت توسط کاربر بسته شده است.' + : 'این تیکت توسط پشتیبانی بسته شده است؛ کاربر نمی‌تواند دوباره باز کند.'} +

+ )}
{ticket.messages.map((message) => ( @@ -129,7 +160,10 @@ const AdminSupportTicketDetail = () => { setReply(String(value)) }} /> -

پس از ثبت پاسخ، برای کاربر پیامک اطلاع‌رسانی ارسال می‌شود.

+

+ می‌توانید چند پیام پشت‌سرهم بفرستید. کاربر فقط بعد از پاسخ شما یک پیام می‌تواند بفرستد. پس از ثبت پاسخ، برای کاربر پیامک + اطلاع‌رسانی ارسال می‌شود. +