Skip to content

Commit e2a0652

Browse files
Merge pull request #64 from drivly/codex/create-docssidebar-component-with-links
Add DocsSidebar component
2 parents 9f1ee33 + ddc7889 commit e2a0652

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
'use client'
2+
3+
export interface DocsSection {
4+
href: string
5+
label: string
6+
}
7+
8+
const DEFAULT_SECTIONS: DocsSection[] = [
9+
{ href: '/docs/introduction', label: 'Introduction' },
10+
{ href: '/docs/getting-started', label: 'Getting Started' },
11+
{ href: '/docs/api', label: 'API Reference' },
12+
{ href: '/docs/faq', label: 'FAQ' },
13+
]
14+
15+
export function DocsSidebar({ sections = DEFAULT_SECTIONS }: { sections?: DocsSection[] }) {
16+
return (
17+
<aside>
18+
<nav>
19+
<ul>
20+
{sections.map((s) => (
21+
<li key={s.href}>
22+
<a href={s.href}>{s.label}</a>
23+
</li>
24+
))}
25+
</ul>
26+
</nav>
27+
</aside>
28+
)
29+
}

0 commit comments

Comments
 (0)