import { useGlobal } from '@/lib/global' import { useGitBookGlobal } from '@/themes/gitbook' import { useRouter } from 'next/router' import { useEffect } from 'react' import Catalog from './Catalog' /** * 懸浮抽屜目錄 * @param toc * @param post * @returns {JSX.Element} * @constructor */ const CatalogDrawerWrapper = ({ post, cRef }) => { const { tocVisible, changeTocVisible } = useGitBookGlobal() const { locale } = useGlobal() const router = useRouter() const switchVisible = () => { changeTocVisible(!tocVisible) } useEffect(() => { changeTocVisible(false) }, [router]) return ( <>