"use client"; import { useState, useEffect } from "react"; import { ChevronUp } from "lucide-react"; import { UI_CONFIG } from "@/lib/config"; export function BackToTop() { const [visible, setVisible] = useState(false); useEffect(() => { function handleScroll() { setVisible(window.scrollY > UI_CONFIG.scrollThresholds.backToTop); } window.addEventListener("scroll", handleScroll, { passive: true }); return () => window.removeEventListener("scroll", handleScroll); }, []); return ( ); }