mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-11 16:52:38 +02:00
feat: add SidebarSeparator component and integrate into documentation layout
- Introduced SidebarSeparator component for improved sidebar organization. - Updated layout configuration to utilize the new SidebarSeparator in the documentation layout.
This commit is contained in:
parent
394a37576c
commit
2468cc2a4a
2 changed files with 18 additions and 0 deletions
|
|
@ -2,6 +2,7 @@ import { DocsLayout } from "fumadocs-ui/layouts/docs";
|
|||
import type { ReactNode } from "react";
|
||||
import { baseOptions } from "@/app/layout.config";
|
||||
import { source } from "@/lib/source";
|
||||
import { SidebarSeparator } from "./sidebar-separator";
|
||||
|
||||
const gridTemplate = `"sidebar header toc"
|
||||
"sidebar toc-popover toc"
|
||||
|
|
@ -13,6 +14,11 @@ export default function Layout({ children }: { children: ReactNode }) {
|
|||
tree={source.pageTree}
|
||||
{...baseOptions}
|
||||
containerProps={{ style: { gridTemplate }, className: "bg-fd-card" }}
|
||||
sidebar={{
|
||||
components: {
|
||||
Separator: SidebarSeparator,
|
||||
},
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</DocsLayout>
|
||||
|
|
|
|||
12
surfsense_web/app/docs/sidebar-separator.tsx
Normal file
12
surfsense_web/app/docs/sidebar-separator.tsx
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
"use client";
|
||||
|
||||
import type { Separator } from "fumadocs-core/page-tree";
|
||||
|
||||
export function SidebarSeparator({ item }: { item: Separator }) {
|
||||
return (
|
||||
<p className="inline-flex items-center gap-2 mb-1.5 px-2 mt-6 font-semibold first:mt-0 empty:mb-0">
|
||||
{item.icon}
|
||||
{item.name}
|
||||
</p>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue