diff --git a/src/screens/Enquiry.tsx b/src/screens/Enquiry.tsx index bd13355..dd39324 100644 --- a/src/screens/Enquiry.tsx +++ b/src/screens/Enquiry.tsx @@ -217,6 +217,11 @@ function author(tag: string): { label: string; tone: 'ai' | 'human' | 'auto' } { return { label: `Desk ยท ${tag}`, tone: 'auto' }; } const REPLY_STATES = ['Awaiting Ops Input', 'Awaiting Offer', 'Offer Sent', 'Confirmed']; +/** WhatsApp bold markers (*text*) as the customer sees them. Email messages carry none. */ +function richText(text: string): ReactNode { + const parts = text.split(/(\*[^*\n]+\*)/g); + return parts.map((p, i) => (p.length > 2 && p.startsWith('*') && p.endsWith('*') ? {p.slice(1, -1)} : {p})); +} function Conversation({ e, onDone }: { e: Enquiry; onDone: () => void }) { const { has, user } = useZino(); @@ -251,7 +256,7 @@ function Conversation({ e, onDone }: { e: Enquiry; onDone: () => void }) { {a?.tone === 'human' && } {m.who === 'Customer' ? 'Customer' : a!.label} -
{m.text}
+
{richText(m.text)}
);