Skip to content
Myr

docs-nav.tsx

This file

Path

apps/web/src/features/shared/shell/docs-nav.tsx

41 lines · 1.5 KiB · TypeScript

Last changed by

Merge redesign into mainoscabrielbefore adoptioncaedd21

History of this file

Take it

Merge redesign into mainoscabrielbefore adoptioncaedd21

lines 1–41why, one step back
1import { docEntries } from "@repo/agent-kit/docs/entries";
2import type { DocPart } from "@repo/agent-kit/docs/entries";34import { AppLink } from "../link.tsx";5import { docsPath } from "../paths.ts";67const PARTS = [8 { part: "guide", title: "Guides" },9 { part: "reference", title: "Reference" },10] as const satisfies readonly { part: DocPart; title: string }[];1112const EXACT = { exact: true, includeSearch: false } as const;1314const LINK =15 "text-ui text-muted-foreground hover:text-foreground hover:bg-surface aria-[current=page]:text-foreground flex min-h-8 items-center px-2 no-underline transition-colors duration-[120ms] aria-[current=page]:font-medium";1617/** The docs shell's tree: every page by its part, the one being read current. */18export const DocsNav = () => (19 <nav aria-label="Docs" className="flex flex-col gap-4">20 {PARTS.map(({ part, title }) => (21 <div className="flex flex-col gap-1" key={part}>22 <h2 className="text-ui px-2 font-semibold">{title}</h2>23 <ul className="flex flex-col gap-px">24 {docEntries25 .filter((entry) => entry.part === part)26 .map(({ slug, title: pageTitle }) => (27 <li key={slug}>28 <AppLink29 activeOptions={EXACT}30 className={LINK}31 to={docsPath(slug)}32 >33 {pageTitle}34 </AppLink>35 </li>36 ))}37 </ul>38 </div>39 ))}40 </nav>41);