'use client'; import siteMetadata from '@/data/siteMetadata'; import { useEffect, useState } from 'react'; const ScrollTopAndComment = () => { const [show, setShow] = useState(false); useEffect(() => { const handleWindowScroll = () => { if (window.scrollY > 50) setShow(true); else setShow(false); }; window.addEventListener('scroll', handleWindowScroll); return () => window.removeEventListener('scroll', handleWindowScroll); }, []); const handleScrollTop = () => { window.scrollTo({ top: 0 }); }; const handleScrollToComment = () => { document.getElementById('comment')?.scrollIntoView(); }; return ( ); }; export default ScrollTopAndComment;