'use client'; import React, { useEffect, useRef } from 'react'; import Link from 'next/link'; import { X, Zap, BarChart2, RefreshCw, Palette } from 'lucide-react'; import { Button } from '@/components/ui/Button'; interface PostDownloadPopupProps { open: boolean; onClose: () => void; } const BENEFITS = [ { icon: RefreshCw, text: 'Edit the link anytime — QR stays the same' }, { icon: BarChart2, text: 'See who scans, when & where' }, { icon: Palette, text: 'Custom colors, logo & frames' }, { icon: Zap, text: 'Free plan included — upgrade anytime for more' }, ]; const LS_KEY = 'qrm_download_popup_seen'; export function shouldShowDownloadPopup(): boolean { try { return !localStorage.getItem(LS_KEY); } catch { return false; } } export function markDownloadPopupSeen(): void { try { localStorage.setItem(LS_KEY, '1'); } catch { /* ignore */ } } export default function PostDownloadPopup({ open, onClose }: PostDownloadPopupProps) { const overlayRef = useRef(null); useEffect(() => { if (!open) return; markDownloadPopupSeen(); const onKey = (e: KeyboardEvent) => { if (e.key === 'Escape') onClose(); }; document.addEventListener('keydown', onKey); return () => document.removeEventListener('keydown', onKey); }, [open, onClose]); if (!open) return null; return (
{ if (e.target === overlayRef.current) onClose(); }} >
{/* Header */}

Your QR code is downloading!

Want to make it smarter — for free?

{/* Benefits */}
{BENEFITS.map(({ icon: Icon, text }) => (
{text}
))}
{/* CTAs */}
); }