"use client"; import React, { useEffect, useState } from "react"; import { useContent } from "./ContentProvider"; export const InteractiveElements: React.FC = () => { const { nav } = useContent(); const [progress, setProgress] = useState(0); const [showBackToTop, setShowBackToTop] = useState(false); useEffect(() => { const handleScroll = () => { const scrollTop = window.scrollY; const docHeight = document.documentElement.scrollHeight - window.innerHeight; if (docHeight > 0) { setProgress((scrollTop / docHeight) * 100); } setShowBackToTop(scrollTop > 300); }; window.addEventListener("scroll", handleScroll); return () => window.removeEventListener("scroll", handleScroll); }, []); const scrollToTop = () => { window.scrollTo({ top: 0, behavior: "smooth" }); }; return ( <> {/* Reading Progress Bar */}
{/* Floating Back to Top Button */} > ); };