/** * WhatsApp Helper Utilities for Vietnam Wedding Guide (VWG) * * Centralizes WhatsApp deep-link generation to ensure: * 1. Consistent formatting across all CTAs (floating button, nav, banners, cards). * 2. Proper URL encoding of prefilled contextual messages. * 3. Consistent phone number targeting (wa.me/84908372168). */ export const DEFAULT_WHATSAPP_NUMBER = "84908372168"; export function getWhatsAppUrl( message?: string, number: string = DEFAULT_WHATSAPP_NUMBER ): string { const cleanNumber = ( process.env.NEXT_PUBLIC_WHATSAPP_NUMBER || number ).replace(/[^0-9]/g, ""); const defaultMsg = "Hello Nhi, I would like to inquire about wedding advisory in Vietnam."; const text = message?.trim() || defaultMsg; return `https://wa.me/${cleanNumber}?text=${encodeURIComponent(text)}`; } /** * Returns contextual default WhatsApp inquiry message tailored to current route. */ export function getContextualWhatsAppMessage(pathname: string): string { if (pathname.startsWith("/services/b2b")) { return "Hello Nhi, I would like to inquire about B2B Venue Advisory & Resort Consulting in Vietnam."; } if ( pathname.startsWith("/services/couples") || pathname.startsWith("/services/private-consultant") ) { return "Hello Nhi, I would like to inquire about Private Couple Wedding Advisory in Vietnam."; } if (pathname.startsWith("/services")) { return "Hello Nhi, I would like to inquire about your wedding advisory services in Vietnam."; } if (pathname.startsWith("/blog/")) { return "Hello Nhi, I am reading your wedding guide on Vietnam Wedding Guide and would like to ask a question."; } if (pathname.startsWith("/blog")) { return "Hello Nhi, I am browsing your Vietnam Wedding Guides and would like to ask for advisory."; } if (pathname === "/contact") { return "Hello Nhi, I would like to schedule a private discovery consultation for our wedding in Vietnam."; } if (pathname === "/about") { return "Hello Nhi, I just read about the vision of Vietnam Wedding Guide and would like to connect."; } // Default for Homepage and others return "Hello Nhi, I would like to inquire about destination wedding advisory in Vietnam."; }