import { useState } from 'react' import Catalog from './Catalog' /** * 移动端悬浮目录按钮 */ export default function FloatTocButton(props) { const [tocVisible, changeTocVisible] = useState(false) const { post } = props const toggleToc = () => { changeTocVisible(!tocVisible) } // 没有目录就隐藏该按钮 if (!post || !post.toc || post.toc.length < 1) { return <>> } return (