apps: - api: Hono REST server, all §26 endpoints, 14 tests - worker: delivery runner + payment-confirm + access-sync + renewal + webhook-retry jobs wired to real package clients - dashboard: Next.js merchant dashboard, full §16/§27 sections + §28 product builder - checkout: Next.js hosted USDC checkout with real delivery materialization - marketplace: Next.js public marketplace + agent metadata.json route - admin: Next.js risk/ops console wired to @settlekit/risk + database - docs: Next.js docs site (9 static routes) - examples: 5 runnable end-to-end examples fix(x402): support pinned config.nonce so a stateless verifier can confirm the challenge nonce round-trips (default stays random; package tests intact). Full workspace: 590 tests passing (122 files), tsc green for all packages + api/worker/examples, all 5 Next apps typecheck clean, docs next build green.
54 lines
1.5 KiB
TypeScript
54 lines
1.5 KiB
TypeScript
/**
|
|
* Nav — the docs sidebar.
|
|
*
|
|
* Client component so it can highlight the active route via usePathname. Reads
|
|
* its structure from lib/nav.ts (the single source of truth) and renders one
|
|
* labelled group per NavSection.
|
|
*/
|
|
"use client";
|
|
|
|
import Link from "next/link";
|
|
import { usePathname } from "next/navigation";
|
|
import { NAV } from "../lib/nav";
|
|
|
|
function isActive(pathname: string, href: string): boolean {
|
|
if (href === "/") return pathname === "/";
|
|
return pathname === href || pathname.startsWith(`${href}/`);
|
|
}
|
|
|
|
export function Nav() {
|
|
const pathname = usePathname();
|
|
|
|
return (
|
|
<nav className="nav" aria-label="Documentation">
|
|
<Link href="/" className="nav__brand">
|
|
SettleKit Docs
|
|
</Link>
|
|
{NAV.map((section) => (
|
|
<div className="nav__section" key={section.title}>
|
|
<p className="nav__section-title">{section.title}</p>
|
|
<ul className="nav__list">
|
|
{section.items.map((item) => (
|
|
<li key={item.href}>
|
|
<Link
|
|
href={item.href}
|
|
className={
|
|
isActive(pathname, item.href)
|
|
? "nav__link nav__link--active"
|
|
: "nav__link"
|
|
}
|
|
aria-current={isActive(pathname, item.href) ? "page" : undefined}
|
|
>
|
|
{item.title}
|
|
</Link>
|
|
</li>
|
|
))}
|
|
</ul>
|
|
</div>
|
|
))}
|
|
</nav>
|
|
);
|
|
}
|
|
|
|
export default Nav;
|