mirror of
https://github.com/zoriya/v10.git
synced 2026-08-14 18:04:49 +00:00
30 lines
846 B
Plaintext
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>
|