"use client"; import React, { useState, useEffect } from "react"; import { motion, AnimatePresence } from "framer-motion"; import { X, ArrowRight } from "lucide-react"; import { useLanguage } from "@/components/LanguageContext"; export function WaitlistSocialProofTicker() { const { t, language } = useLanguage(); const [isVisible, setIsVisible] = useState(false); const [isDismissed, setIsDismissed] = useState(false); const [queueCount, setQueueCount] = useState(2147); useEffect(() => { if (isDismissed) return; // Show initial notification after a brief delay const initialDelay = setTimeout(() => { setIsVisible(true); }, 2000); // Simulate occasional live queue increments const interval = setInterval(() => { if (Math.random() > 0.5) { setQueueCount((prev) => prev + Math.floor(Math.random() * 3) + 1); } }, 8500); return () => { clearTimeout(initialDelay); clearInterval(interval); }; }, [isDismissed]); if (isDismissed) return null; return ( {isVisible && ( { // Focus on waitlist form or scroll to it document.getElementById('email-input')?.scrollIntoView({ behavior: 'smooth', block: 'center' }); setTimeout(() => { document.getElementById('email-input')?.focus(); }, 500); }} > {/* Glowing Green Signal Pulse */}
{/* Event Content */}
{t("tickerLive")} • {language === "ar" ? ( <> هناك {queueCount.toLocaleString()} {t("tickerDevelopers")} ) : ( <> {queueCount.toLocaleString()} {t("tickerDevelopers")} )} • {t("tickerClaim")}
{/* Close Action */}
)}
); }