import { getPageTableOfContents } from 'notion-utils' import LayoutBase from './LayoutBase' import { useGlobal } from '@/lib/global' import React from 'react' import Catalog from './components/Catalog' import { ArticleDetail } from './components/ArticleDetail' import { ArticleLock } from './components/ArticleLock' export const LayoutSlug = props => { const { post, lock, validPassword } = props if (!post) { return } if (!lock && post?.blockMap?.block) { post.content = Object.keys(post.blockMap.block) post.toc = getPageTableOfContents(post, post.blockMap) } const { locale } = useGlobal() const slotRight = post?.toc && post?.toc?.length > 3 && (
) return ( {!lock && } {lock && } ) }