diff --git a/components/post-toc.tsx b/components/post-toc.tsx index 909c93a..c1e1615 100644 --- a/components/post-toc.tsx +++ b/components/post-toc.tsx @@ -13,8 +13,8 @@ interface TocItem { export function PostToc() { const [items, setItems] = useState([]); const [activeId, setActiveId] = useState(null); - const listRef = useRef(null); - const itemRefs = useRef>({}); + const listRef = useRef(null); + const itemRefs = useRef>({}); const [indicator, setIndicator] = useState({ top: 0, opacity: 0 }); useEffect(() => { @@ -104,19 +104,19 @@ export function PostToc() { style={{ top: `${indicator.top}px`, opacity: indicator.opacity }} aria-hidden="true" /> -
    {items.map((item) => ( -
  • { itemRefs.current[item.id] = el; }} + role="listitem" className={`relative ${item.depth === 3 ? 'pl-3' : 'pl-0'}`} - style={{ listStyleType: 'none' }} > -
  • + ))} -
+ );