import { motion, AnimatePresence } from "motion/react"; import { useMemo } from "react"; import { Sparkles, Gift, Check } from "lucide-react"; interface RewardModalProps { isOpen: boolean; onClose: () => void; topicTitle: string; } interface FloatingParticle { id: number; x: number; duration: number; delay: number; color: string; } export function RewardModal({ isOpen, onClose, topicTitle }: RewardModalProps) { const floatingParticles = useMemo(() => { const viewportWidth = typeof window !== "undefined" ? window.innerWidth : 390; return Array.from({ length: 20 }, (_, i) => ({ id: i, x: Math.random() * viewportWidth, duration: 3 + Math.random() * 2, delay: Math.random() * 2, color: i % 2 === 0 ? "#FFB800" : "#8ACEE0", })); }, []); return ( {isOpen && ( {/* Backdrop */} {/* Modal Content */} e.stopPropagation()} className="relative max-w-sm w-full" dir="rtl" > {/* Sparkle effects around the card */} {Array.from({ length: 12 }).map((_, i) => ( ))} {/* Main Card */}
{/* Animated background gradient */} {/* Success Icon */}
{/* Glow effect */}
{/* Title */} 🎉 تبریک! 🎉 {/* Description */}

چالش با موفقیت به پایان رسید!

پست شما بعد از بررسی منتشر می‌شود

{/* Reward Section */}
{/* Animated shine effect */}

جایزه دریافت شد!

مدال {topicTitle} به کیف جادوییت اضافه شد!

{/* Close Button */} باشه، بریم!
{/* Floating particles in background */} {floatingParticles.map((particle) => ( ))} )}
); }