'use client'; import React, { useState, useEffect } from 'react'; import { Icon } from './Icon'; export interface BackToTopProps { threshold?: number; variant?: 'default' | 'luxury'; className?: string; } export function BackToTop({ threshold = 350, variant = 'luxury', className = '', }: BackToTopProps) { const [visible, setVisible] = useState(false); useEffect(() => { const handleScroll = () => { setVisible(window.scrollY > threshold); }; window.addEventListener('scroll', handleScroll, { passive: true }); return () => window.removeEventListener('scroll', handleScroll); }, [threshold]); const scrollToTop = () => { window.scrollTo({ top: 0, behavior: 'smooth' }); }; if (!visible) return null; const isLuxury = variant === 'luxury'; return ( ); }