@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 07:15 UTC

main
tsx 12 lines 417 Bytes
Raw
1 import { usePageContext } from "vike-react/usePageContext";
2
3 export function Link({ href, children }: { href: string; children: string }) {
4 const pageContext = usePageContext();
5 const { urlPathname } = pageContext;
6 const isActive = href === "/" ? urlPathname === href : urlPathname.startsWith(href);
7 return (
8 <a href={href} className={isActive ? "is-active" : undefined}>
9 {children}
10 </a>
11 );
12 }