import { createSignal, onMount, onCleanup, Show } from "solid-js"; import { A, useLocation } from "@solidjs/router"; import { cn } from "~/lib/utils"; import { Button } from "~/components/ui"; import { Typewriter } from "~/components/ui/Typewriter"; import { useTheme } from "~/lib/theme"; import { SignedIn, SignedOut, UserButton } from "clerk-solidjs"; import { useRealtimeAlerts } from "~/hooks/useRealtimeAlerts"; function ShieldLogo() { return ( ); } function ThemeToggle() { const { toggle, resolved } = useTheme(); const [mounted, setMounted] = createSignal(false); onMount(() => { setMounted(true); }); return ( ); } const marketingLinks = [ { label: "Features", href: "/features" }, { label: "Pricing", href: "/pricing" }, { label: "Blog", href: "/blog" }, ]; const productLinks = [ { label: "Dashboard", href: "/dashboard" }, { label: "DarkWatch", href: "/darkwatch" }, { label: "VoicePrint", href: "/voiceprint" }, { label: "SpamShield", href: "/spamshield" }, { label: "HomeTitle", href: "/hometitle" }, { label: "RemoveBrokers", href: "/removebrokers" }, ]; function RealtimeIndicator() { const { connectionStatus, unreadCount, clearUnread } = useRealtimeAlerts(); return (
0}>
) : (
) } >
); } export default function Navbar() { const [mobileOpen, setMobileOpen] = createSignal(false); const [scrolled, setScrolled] = createSignal(false); const location = useLocation(); onMount(() => { const onScroll = () => { setScrolled(window.scrollY > 8); }; window.addEventListener("scroll", onScroll, { passive: true }); onCleanup(() => window.removeEventListener("scroll", onScroll)); }); const isActive = (href: string) => { if (href === "/dashboard") return location.pathname === "/dashboard"; return location.pathname.startsWith(href); }; const NavLink = (props: { href: string; label: string; mobile?: boolean; }) => ( props.mobile && setMobileOpen(false)} > {props.label} ); return ( ); }