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 ( <>
tldraw © 2023
setMenuOpen(false)}>Close
{/* Menu */} ) } function SidebarLink(props: SidebarContentLink) { switch (props.type) { case 'section': { return } case 'article': { return } case 'category': { return } } } function SidebarSection({ title, url, children }: SidebarContentSectionLink) { return (
  • {title}
      {children.map((link) => ( ))}
  • ) } function SidebarCategory({ title, url, children }: SidebarContentCategoryLink) { return (
  • {title}
      {children.map((link) => ( ))}

  • ) } function SidebarArticle({ title, url }: SidebarContentArticleLink) { return (
  • {title}
  • ) }