Skip to documentation
Design system / Sources & standards
Current repository source
public-navigation.tsx
src/components/navigation/instances/public-navigation.tsx
This view contains the escaped source read during the deployment build. Code and policy text are unchanged. Markdown is shown as source, not rendered as a document. A new deployment refreshes the content.
"use client";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { TopNav } from "../topNav";
import { AuthButton } from "../authButton";
import type { PublicShellProps } from "./public-shell";
const items = [
{ label: "Home", href: "/" },
{ label: "Praxis", href: "/praxis" },
{ label: "Design system", href: "/design-system" },
{ label: "Console", href: "/console/sign-in" },
];
/** Public instance owns URL selection and copy; TopNav owns links and styling. */
export function PublicNavigation({
breadcrumbs,
rightSlot,
}: Omit<PublicShellProps, "children">) {
const pathname = usePathname() ?? "";
return (
<TopNav
brand={
<Link href="/" className="text-lg font-semibold tracking-tight">
CreativeXHub
</Link>
}
items={items.map((item) => ({
...item,
isCurrent:
item.href === "/"
? pathname === "/"
: pathname === item.href || pathname.startsWith(`${item.href}/`),
}))}
breadcrumbs={breadcrumbs}
rightSlot={
rightSlot ?? (
<AuthButton
isAuthenticated={false}
signInHref="/console/sign-in"
signOutHref="/console/sign-out"
/>
)
}
/>
);
}
All sources and standards