diff --git a/newwhats.clube67.com/newwhats.local/frontend/components/MessageBubble.tsx b/newwhats.clube67.com/newwhats.local/frontend/components/MessageBubble.tsx index ea27d23..3a18637 100644 --- a/newwhats.clube67.com/newwhats.local/frontend/components/MessageBubble.tsx +++ b/newwhats.clube67.com/newwhats.local/frontend/components/MessageBubble.tsx @@ -150,6 +150,11 @@ const AudioBubble: React.FC = ({ msg, fullMediaUrl, isOut, Tim + {msg.transcription && ( +

+ 🎤 {msg.transcription} +

+ )} {TimestampRow} ) @@ -652,6 +657,13 @@ const MessageBubble: React.FC = ({
{TimestampEl}
)} + {msg.transcription && ( +
+

+ 👁 {msg.transcription} +

+
+ )} ); } diff --git a/newwhats.clube67.com/newwhats.local/frontend/hooks/inbox/useNewInboxBridge.ts b/newwhats.clube67.com/newwhats.local/frontend/hooks/inbox/useNewInboxBridge.ts index 1fbc605..8856db3 100644 --- a/newwhats.clube67.com/newwhats.local/frontend/hooks/inbox/useNewInboxBridge.ts +++ b/newwhats.clube67.com/newwhats.local/frontend/hooks/inbox/useNewInboxBridge.ts @@ -80,6 +80,7 @@ function messagesToLegacy(msgs: ReturnType['messag status: m.status.toLowerCase(), type: m.type.toLowerCase(), media_url: m.mediaUrl, + transcription: (m as any).transcription ?? null, mime_type: m.mimeType, reply_to_id: m.replyToId, // Quoted message — mapeia replyTo do Prisma para o formato do MessageBubble diff --git a/newwhats.clube67.com/newwhats.local/frontend/store/chatStore.ts b/newwhats.clube67.com/newwhats.local/frontend/store/chatStore.ts index 501e978..9fab4e7 100644 --- a/newwhats.clube67.com/newwhats.local/frontend/store/chatStore.ts +++ b/newwhats.clube67.com/newwhats.local/frontend/store/chatStore.ts @@ -81,6 +81,7 @@ export interface Message { type: string body: string | null mediaUrl: string | null + transcription?: string | null mimeType: string | null fileName: string | null replyToId: string | null @@ -411,6 +412,10 @@ export const useChatStore = create()( get().updateMediaReady(messageId, mediaUrl) }) + socketService.on('message:transcription', ({ messageId, transcription }: { messageId: string; transcription: string }) => { + get().patchMessage(messageId, { transcription }) + }) + socketService.on('message:status', ({ messageId, status }: { messageId: string; status: Message['status'] }) => { get().patchMessage(messageId, { status }) }) diff --git a/newwhats.clube67.com/newwhats.local/frontend/types/inboxTypes.ts b/newwhats.clube67.com/newwhats.local/frontend/types/inboxTypes.ts index e37af04..fb5f8ac 100644 --- a/newwhats.clube67.com/newwhats.local/frontend/types/inboxTypes.ts +++ b/newwhats.clube67.com/newwhats.local/frontend/types/inboxTypes.ts @@ -44,6 +44,7 @@ export interface Message { instance_name?: string; sender_jid?: string; rich_payload?: RichPayload | null; + transcription?: string | null; } export interface WhatsAppInstance {