/* ============================================================ 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 (
{" "} UNLIMITED Resources cPanel hosting from $2.95/mo.{" "} See plans →
); } /* ---------- Top Nav ---------- */ function TopNav({ route }) { const [open, setOpen] = useState(false); const navItems = [ { to: "/hosting", label: "cPanel Hosting" }, { to: "/pricing", label: "Pricing" }, { to: "/locations", label: "Locations" }, { to: "/docs", label: "Docs" }, { to: "https://loominost.com/whmcs/contact.php", label: "Contact" }, ]; return (
Client Login Get started
); } /* ---------- Footer ---------- */ function Footer() { return ( ); } function FooterCol({ title, items }) { return (
{title}
); } Object.assign(window, { useHashRoute, Link, AnnouncementBar, TopNav, Footer });