mirror of
https://github.com/Dokploy/website
synced 2025-06-26 18:16:01 +00:00
feat: add fallback state for empty table of contents
This commit is contained in:
@@ -47,6 +47,8 @@ export function TableOfContents() {
|
|||||||
<nav className="space-y-2 text-sm">
|
<nav className="space-y-2 text-sm">
|
||||||
<p className="font-medium mb-4">Table of Contents</p>
|
<p className="font-medium mb-4">Table of Contents</p>
|
||||||
<ul className="space-y-2">
|
<ul className="space-y-2">
|
||||||
|
{headings.length > 0 ? (
|
||||||
|
<>
|
||||||
{headings.map((heading) => (
|
{headings.map((heading) => (
|
||||||
<li
|
<li
|
||||||
key={heading.id}
|
key={heading.id}
|
||||||
@@ -70,6 +72,12 @@ export function TableOfContents() {
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<li>
|
||||||
|
<p className="text-muted-foreground">No headings found</p>
|
||||||
|
</li>
|
||||||
|
)}
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user