/* ============================================================ Shared chrome — Nav, Footer, Router helpers ============================================================ */ const { useState, useEffect, useRef, useMemo } = React; /* ---------- Hash router ---------- */ function useHashRoute() { const [route, setRoute] = useState(() => (window.location.hash || "#/").replace(/^#/, "") || "/"); useEffect(() => { const onHash = () => { setRoute((window.location.hash || "#/").replace(/^#/, "") || "/"); window.scrollTo({ top: 0, behavior: "instant" }); }; window.addEventListener("hashchange", onHash); return () => window.removeEventListener("hashchange", onHash); }, []); return route; } function Link({ to, children, className = "", style = {}, onClick }) { // External / WHMCS links: render as real anchor (new tab optional) const isExternal = /^https?:\/\//.test(to) || to.startsWith("/whmcs") || to.startsWith("mailto:"); const href = isExternal ? to : "#" + to; return ( { onClick && onClick(e); }} > {children} ); } /* ---------- WHMCS endpoint constants ---------- Loominost WHMCS lives at /whmcs/ — update if yours differs. */ const WHMCS = { signup: "/whmcs/index.php?rp=/store/shared-hosting-cpanel", login: "/whmcs/index.php?rp=/login", register: "/whmcs/index.php?rp=/register", cart: "/whmcs/cart.php", ticket: "/whmcs/submitticket.php", sales: "/whmcs/submitticket.php?step=2&deptid=1", support: "/whmcs/submitticket.php?step=2&deptid=2", abuse: "/whmcs/contact.php", status: "/whmcs/serverstatus.php", kb: "/whmcs/knowledgebase.php", news: "/whmcs/announcements.php", clientarea: "/whmcs/clientarea.php", }; window.WHMCS = WHMCS; /* ---------- Announcement bar ---------- */ function AnnouncementBar() { return (