import { Head } from "$fresh/runtime.ts";
import {
CATEGORIES,
TableOfContentsCategory,
TableOfContentsCategoryEntry,
} from "../data/docs.ts";
import SearchButton from "../islands/SearchButton.tsx";
export default function DocsSidebar(props: { path: string; mobile?: boolean }) {
const id = String(Math.random()).replaceAll(".", "");
return (
<>
{props.mobile
? (
)
: }
{CATEGORIES.map((category) => (
))}
>
);
}
const link = "text(gray-900 hover:gray-600)";
const linkActive = "text(green-600 hover:green-500)";
export function SidebarCategory(props: {
path: string;
category: TableOfContentsCategory;
}) {
const { title, href, entries } = props.category;
const outerLink = `${href == props.path ? linkActive : link} font-bold`;
return (
{title}
{entries.length > 0 && (
{entries.map((entry) => (
))}
)}
);
}
export function SidebarEntry(props: {
path: string;
entry: TableOfContentsCategoryEntry;
}) {
const { title, href } = props.entry;
const innerLink = `${href == props.path ? linkActive : link} font-normal`;
return (
{title}
);
}