Files
v10/site/src/components/docs/DocsSidebar.astro
T
2026-04-14 09:50:53 -05:00

30 lines
846 B
Plaintext

---
import clsx from 'clsx';
import { PreferenceUpdater } from '@/components/docs/PreferenceUpdater';
import SidebarItem from '@/components/docs/SidebarItem.astro';
import type { SupportedFramework } from '@/types/docs';
import { filterSidebar } from '@/utils/docs/sidebar';
type Props = {
framework: SupportedFramework;
docTitles: Map<string, string>;
class?: string;
};
const { framework, docTitles, class: className } = Astro.props;
const filteredSidebar = filterSidebar(framework);
---
<div class={clsx("bg-manila-light dark:bg-faded-black", className)}>
<slot />
<PreferenceUpdater client:idle currentFramework={framework} />
<nav aria-label="Docs sidebar" class="p-6">
{
filteredSidebar.map((item) => (
<SidebarItem item={item} framework={framework} docTitles={docTitles} />
))
}
</nav>
</div>