import { SidebarContentArticleLink, SidebarContentCategoryLink, SidebarContentLink, SidebarContentList, SidebarContentSectionLink, } from '@/types/content-types' import Link from 'next/link' import { useRouter } from 'next/router' import { useEffect, useState } from 'react' import { Icon } from './Icon' import { Search } from './Search' import { ThemeSwitcher } from './ThemeSwitcher' type SidebarProps = SidebarContentList export function Sidebar({ links, sectionId, categoryId, articleId }: SidebarProps) { const [menuOpen, setMenuOpen] = useState(false) const activeId = articleId ?? categoryId ?? sectionId const router = useRouter() useEffect(() => { setMenuOpen(false) }, [router.asPath]) return ( <>
{/* Menu */} > ) } function SidebarLink(props: SidebarContentLink) { switch (props.type) { case 'section': { return