From c3dba17ba9f1cfa6abf5765515a71fe889061844 Mon Sep 17 00:00:00 2001 From: Yashas Date: Mon, 26 Oct 2026 17:26:19 +0530 Subject: [PATCH] Show the enquiry's channel: email thread vs WhatsApp, and the offer button says which Co-Authored-By: Claude Fable 5.1 --- src/screens/Enquiry.tsx | 16 +++++++++------- src/screens/Inbox.tsx | 6 +++--- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/screens/Enquiry.tsx b/src/screens/Enquiry.tsx index b4430a4..5130af0 100644 --- a/src/screens/Enquiry.tsx +++ b/src/screens/Enquiry.tsx @@ -1,7 +1,7 @@ import { useState } from 'react'; import type { ReactNode } from 'react'; import { Link, useParams } from 'react-router-dom'; -import { ArrowLeft, Check, MessageCircle, Sparkles, X } from 'lucide-react'; +import { ArrowLeft, Check, Mail, MessageCircle, Sparkles, X } from 'lucide-react'; import { useQuery, useZino } from '../api/provider'; import { ACT, RV_ENQUIRIES, TOUCH_POINTS, WF } from '../api/config'; import type { Enquiry } from '../api/types'; @@ -49,7 +49,9 @@ export function EnquiryPage() {

{e.enquiry_ref ?? `Enquiry #${e.instance_id}`}

- {e.customer_contact && +{e.customer_contact.replace(/^\+/, '')} · {e.channel ?? 'whatsapp'}} + {e.customer_contact && (e.channel === 'email' || e.customer_contact.includes('@') + ? {e.customer_contact} · email + : +{e.customer_contact.replace(/^\+/, '')} · WhatsApp)}
{e.ai_summary &&

{e.ai_summary}

} @@ -61,7 +63,7 @@ export function EnquiryPage() { - + ); @@ -140,13 +142,13 @@ function Outcome({ e }: { e: Enquiry }) { } /** conversation_log is "Customer: …" / "Desk: …" entries separated by blank lines. */ -function Conversation({ log }: { log: string | null }) { +function Conversation({ log, channel }: { log: string | null; channel: string }) { const entries = (log ?? '').split(/\n+(?=(?:Customer|Desk)(?: \([^)\n]{1,24}\))?: )/).map((c) => c.trim()).filter(Boolean).map((chunk) => { const m = chunk.match(/^(Customer|Desk)((?: \([^)\n]{1,24}\))?): ([\s\S]*)$/); return m ? { who: m[1], tag: m[2].trim().replace(/[()]/g, ''), text: m[3] } : { who: 'Desk', tag: '', text: chunk }; }); return ( - +
{entries.length === 0 && No messages yet.} {entries.map((m, i) => ( @@ -272,7 +274,7 @@ function OfferForm({ e, onDone, revise, onCancel }: { e: Enquiry; onDone: () => {error &&
{error}
} {ok &&

{ok}

}
- + {onCancel && } {!revise && }
@@ -290,7 +292,7 @@ function OfferSent({ e, onDone }: { e: Enquiry; onDone: () => void }) { Customer replied : undefined}>

{replied ? 'The customer answered without a plain yes or no. Read the conversation, then revise the offer or close it.' - : 'A plain "confirm" from the customer books the stem automatically. A counter or a question lands here for you.'} + : 'A plain "confirm" from the customer, on WhatsApp or by email, books the stem automatically. A counter or a question lands here for you.'}

diff --git a/src/screens/Inbox.tsx b/src/screens/Inbox.tsx index fdf0982..dcddfea 100644 --- a/src/screens/Inbox.tsx +++ b/src/screens/Inbox.tsx @@ -1,6 +1,6 @@ import { useMemo, useState } from 'react'; import { useNavigate } from 'react-router-dom'; -import { Search } from 'lucide-react'; +import { Mail, MessageCircle, Search } from 'lucide-react'; import { useQuery, useZino } from '../api/provider'; import { RV_ENQUIRIES, STATES } from '../api/config'; import type { Enquiry } from '../api/types'; @@ -44,7 +44,7 @@ export function Inbox() {

Enquiries

-

Every bunker enquiry received on WhatsApp and email, from first message to confirmed stem.

+

Every bunker enquiry received on WhatsApp or email, from first message to confirmed stem.