import { useState, useEffect } from 'react'; import { motion, AnimatePresence } from 'motion/react'; import { X, Download, ShieldCheck, ArrowRight, Mail } from 'lucide-react'; export default function LeadMagnet() { const [isOpen, setIsOpen] = useState(false); const [dismissed, setDismissed] = useState(false); useEffect(() => { // Check if user already dismissed or converted const hasSeen = localStorage.getItem('seo_lead_magnet_dismissed'); if (hasSeen) return; const handleMouseLeave = (e: MouseEvent) => { if (e.clientY <= 0 && !dismissed) { setIsOpen(true); } }; const handleScroll = () => { const scrollPercent = (window.scrollY / (document.documentElement.scrollHeight - window.innerHeight)) * 100; if (scrollPercent > 50 && !dismissed) { setIsOpen(true); } }; document.addEventListener('mouseleave', handleMouseLeave); window.addEventListener('scroll', handleScroll); return () => { document.removeEventListener('mouseleave', handleMouseLeave); window.removeEventListener('scroll', handleScroll); }; }, [dismissed]); const handleClose = () => { setIsOpen(false); setDismissed(true); localStorage.setItem('seo_lead_magnet_dismissed', 'true'); }; return ( {isOpen && (
Resource_Found

Dominate the
Neural_Index 2026.

Download our exclusive blueprint for technical systems and semantic authority protocols.

{ e.preventDefault(); handleClose(); }}>
Interactive Protocol
Audit Framework
)}
); }