'use client' import { useEffect, useState } from 'react' interface StickyFooterProps { url: string title: string } export function StickyFooter({ url, title }: StickyFooterProps) { const [isVisible, setIsVisible] = useState(true) const [lastScrollY, setLastScrollY] = useState(0) const [copied, setCopied] = useState(false) useEffect(() => { const handleScroll = () => { const currentScrollY = window.scrollY setIsVisible(currentScrollY < lastScrollY || currentScrollY < 100) setLastScrollY(currentScrollY) } window.addEventListener('scroll', handleScroll, { passive: true }) return () => window.removeEventListener('scroll', handleScroll) }, [lastScrollY]) const shareLinks = { twitter: `https://twitter.com/intent/tweet?text=${encodeURIComponent(title)}&url=${url}`, linkedin: `https://www.linkedin.com/sharing/share-offsite/?url=${url}`, } const handleCopyLink = async () => { await navigator.clipboard.writeText(url) setCopied(true) setTimeout(() => setCopied(false), 2000) } const scrollToTop = () => { window.scrollTo({ top: 0, behavior: 'smooth' }) } return ( ) }