diff --git a/docs-app/components/WikiNavIcon.tsx b/docs-app/components/WikiNavIcon.tsx new file mode 100644 index 0000000..3dd7b74 --- /dev/null +++ b/docs-app/components/WikiNavIcon.tsx @@ -0,0 +1,39 @@ +// Sidebar icon names follow wiki slugs, not display titles (which can vary by version). +const ICONS: Record = { + '': 'overview', + 'bar-chart': 'bar', + 'heatmap-chart': 'heatmap', + 'histogram-chart': 'histogram', + 'line-chart': 'line', + 'pie-chart': 'pie', + 'radar-chart': 'radar', + 'ring-gauge-chart': 'ring-gauge', + 'scatter-chart': 'scatter', + 'segmented-ring-gauge-chart': 'segmented-ring', + 'stacked-area-chart': 'stacked-area', + 'stacked-bar-chart': 'stacked-bar', + customization: 'customization', + gradients: 'gradients', + migration: 'migration', + screenshots: 'screenshots', +}; + +export function WikiNavIcon({ slug, active }: { slug: string; active: boolean }) { + const icon = ICONS[slug] ?? 'document'; + + return ( + + ); +} diff --git a/docs-app/components/WikiSidebar.tsx b/docs-app/components/WikiSidebar.tsx index fb3b9da..7eb9040 100644 --- a/docs-app/components/WikiSidebar.tsx +++ b/docs-app/components/WikiSidebar.tsx @@ -3,6 +3,7 @@ import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { useRef } from 'react'; +import { WikiNavIcon } from './WikiNavIcon'; import type { NavItem } from '@/lib/types'; import { useScrollActiveIntoView } from '@/lib/use-scroll-active-into-view'; import { cn, stickySidebar } from '@/lib/utils'; @@ -44,7 +45,10 @@ export function WikiSidebar({ navigation }: WikiSidebarProps) { )} aria-current={isActive(item.path) ? 'page' : undefined} > - {item.title} + + + {item.title} + {item.badgeCount ? ( {item.badgeCount} diff --git a/docs-app/public/wiki-nav-icons.svg b/docs-app/public/wiki-nav-icons.svg new file mode 100644 index 0000000..003a7e6 --- /dev/null +++ b/docs-app/public/wiki-nav-icons.svg @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +