MCPcopy Create free account
hub / github.com/outerbase/studio / DocNavigation

Function DocNavigation

src/components/mdx/docs-navigation.tsx:9–85  ·  view source on GitHub ↗
({
  content,
  title,
}: {
  content: DocTableContent;
  title?: string;
})

Source from the content-addressed store, hash-verified

7import { DocTableContent } from "./docs";
8
9export function DocNavigation({
10 content,
11 title,
12}: {
13 content: DocTableContent;
14 title?: string;
15}) {
16 "use client";
17
18 const pathname = usePathname();
19
20 const sideMenu = (
21 <div className="flex flex-col gap-2 p-4 text-sm">
22 {content.map((contentGroup) => {
23 return (
24 <div key={contentGroup.title}>
25 {contentGroup.href ? (
26 <div>
27 <Link
28 href={contentGroup.href ?? ""}
29 className={pathname === contentGroup.href ? "font-bold" : ""}
30 >
31 {contentGroup.title}
32 </Link>
33 </div>
34 ) : (
35 <div>{contentGroup.title}</div>
36 )}
37
38 {contentGroup.sub && (
39 <ul className="my-1">
40 {contentGroup.sub.map((content) => {
41 return (
42 <li
43 key={content.title}
44 className={cn(
45 "border-l border-gray-200 pl-4 py-1.5",
46 pathname === content.href ? "font-bold" : ""
47 )}
48 >
49 <Link href={content.href ?? ""}>{content.title}</Link>
50 </li>
51 );
52 })}
53 </ul>
54 )}
55 </div>
56 );
57 })}
58 </div>
59 );
60
61 return (
62 <>
63 <div className="hidden md:block fixed left-0 top-0 bottom-0 w-[300px] border-r overflow-y-auto">
64 <div className="p-4 border-b">
65 <div className="text-sm">
66 Outerbase <strong>Studio</strong>

Callers

nothing calls this directly

Calls 1

cnFunction · 0.90

Tested by

no test coverage detected