import { A, useLocation } from '@solidjs/router'; import { Show, createEffect, createSignal, onCleanup, onMount } from 'solid-js'; type PublicHeaderProps = { loginHref?: string; signupHref?: string; showAuthActions?: boolean; }; const isRouteActive = (pathname: string, href: string) => { if (href === '/') return pathname === '/'; if (href === '/help-center') return pathname === '/help-center' || pathname.startsWith('/help-center/'); return pathname === href; }; export default function PublicHeader(props: PublicHeaderProps) { const location = useLocation(); const [scrolled, setScrolled] = createSignal(false); const [mobileOpen, setMobileOpen] = createSignal(false); const loginHref = () => props.loginHref || '/auth/login'; const signupHref = () => props.signupHref || '/auth/register'; const showAuthActions = () => props.showAuthActions !== false; onMount(() => { const onScroll = () => setScrolled(window.scrollY > 10); onScroll(); window.addEventListener('scroll', onScroll, { passive: true }); onCleanup(() => window.removeEventListener('scroll', onScroll)); }); createEffect(() => { location.pathname; setMobileOpen(false); }); return (
); }