From 9b98a9e509d58f7b17a7a2dbcc4c0ec8e7322bec Mon Sep 17 00:00:00 2001 From: isra el Date: Wed, 17 Sep 2025 08:40:19 +0300 Subject: [PATCH] fix build issue --- .../(components)/message-history.tsx | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/web/app/(app)/dashboard/(components)/message-history.tsx b/web/app/(app)/dashboard/(components)/message-history.tsx index 41ce25e..1ca05e3 100644 --- a/web/app/(app)/dashboard/(components)/message-history.tsx +++ b/web/app/(app)/dashboard/(components)/message-history.tsx @@ -43,7 +43,8 @@ import { Input } from '@/components/ui/input' import { Textarea } from '@/components/ui/textarea' import { Badge } from '@/components/ui/badge' import { Spinner } from '@/components/ui/spinner' -import { toast } from 'sonner' +import { toast } from '@/hooks/use-toast' + // Helper function to format timestamps const formatTimestamp = (timestamp: string | null | undefined) => { @@ -95,6 +96,7 @@ const getStatusBadge = (status: string) => { } function ReplyDialog({ sms, onClose, open, onOpenChange }: { sms: any; onClose?: () => void; open: boolean; onOpenChange: (open: boolean) => void }) { + const { mutate: sendSms, isPending: isSendingSms, @@ -104,14 +106,17 @@ function ReplyDialog({ sms, onClose, open, onOpenChange }: { sms: any; onClose?: mutationFn: (data: SendSmsFormData) => httpBrowserClient.post(ApiEndpoints.gateway.sendSMS(data.deviceId), data), onSuccess: () => { - toast.success('SMS sent successfully!') + toast({ + title: 'SMS sent successfully!', + }) setTimeout(() => { onOpenChange(false) if (onClose) onClose() }, 1500) }, onError: (error: any) => { - toast.error('Failed to send SMS.', { + toast({ + title: 'Failed to send SMS.', description: error.response?.data?.message || 'Please try again.', }) }, @@ -250,14 +255,17 @@ function FollowUpDialog({ message, onClose, open, onOpenChange }: { message: any mutationFn: (data: SendSmsFormData) => httpBrowserClient.post(ApiEndpoints.gateway.sendSMS(data.deviceId), data), onSuccess: () => { - toast.success('Follow-up SMS sent successfully!') + toast({ + title: 'Follow-up SMS sent successfully!', + }) setTimeout(() => { onOpenChange(false) if (onClose) onClose() }, 1500) }, onError: (error: any) => { - toast.error('Failed to send follow-up SMS.', { + toast({ + title: 'Failed to send follow-up SMS.', description: error.response?.data?.message || 'Please try again.', }) }, @@ -416,7 +424,9 @@ function SmsDetailsDialog({ const handleCopyMessage = () => { if (message?.message) { navigator.clipboard.writeText(message.message) - toast.success('Message copied to clipboard!') + toast({ + title: 'Message copied to clipboard!', + }) } }