diff --git a/src/components/Componentes/navigation-button.tsx b/src/components/Componentes/navigation-button.tsx index 8fb43cf..4eac4b3 100644 --- a/src/components/Componentes/navigation-button.tsx +++ b/src/components/Componentes/navigation-button.tsx @@ -86,6 +86,28 @@ export function NavigationButton({ profile.active_subscription.is_active !== false && profile.active_subscription.is_valid !== false; + const handleDirectSupportContact = () => { + if (typeof window !== "undefined" && "HabibApp" in window) { + try { + const app = ( + window as Window & { + HabibApp?: { postMessage: (msg: string) => void }; + } + ).HabibApp; + app?.postMessage( + JSON.stringify({ + action: "open_consultant_page", + data: { consultant: "habib@gmail.com" }, + }), + ); + } catch (err) { + console.error("Error calling HabibApp bridge", err); + } + } else if (typeof window !== "undefined") { + window.open("mailto:habib@gmail.com", "_blank"); + } + }; + const handleOpenSubscriptionModal = () => { setIsSubscriptionInfoOpen(true); if (!profile) { @@ -326,7 +348,7 @@ export function NavigationButton({ type="button" onClick={() => { setIsDropdownOpen(false); - setIsSupportOpen(true); + handleDirectSupportContact(); }} className="flex w-full items-center gap-3 px-3.5 py-2.5 rounded-[12px] text-start font-medium text-[13.5px] text-[#1F2937] hover:bg-[#F3F4F6] active:bg-[#E5E7EB] transition-colors cursor-pointer border-0 bg-transparent" > @@ -350,10 +372,10 @@ export function NavigationButton({ )} - setIsSupportOpen(false)} - /> + /> */} {isRulesOpen && ( ) : null} - setIsSupportOpen(false)} - /> + /> */} {renderSubscriptionModal()}