diff --git a/apps/landing/src/app/_components/HeroSection.tsx b/apps/landing/src/app/_components/HeroSection.tsx index 350160e..91c741d 100644 --- a/apps/landing/src/app/_components/HeroSection.tsx +++ b/apps/landing/src/app/_components/HeroSection.tsx @@ -1,10 +1,5 @@ -'use client'; - -import { useState } from 'react'; -import { Zap, Globe, FlaskConical, AtSign, Link, Check } from 'lucide-react'; -import GlowEffect from './GlowEffect'; -import WaitlistPopup from './WaitlistPopup'; -import { submitEmail, submitWaitlistData } from '@/lib/actions/waitlistActions'; +import { Zap, Globe, FlaskConical, AtSign, Link } from 'lucide-react'; +import { WaitlistEmailForm } from './WaitlistEmailForm'; const styles = ` .gradient-text { @@ -35,44 +30,6 @@ const styles = ` 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } } - - .hero-btn { - transition: all 0.2s ease; - } - - .hero-btn.enabled { - cursor: pointer; - } - - .hero-btn.disabled { - cursor: not-allowed; - } - - .hero-btn.disabled:hover { - background: rgba(100, 100, 120, 0.4) !important; - } - - .success-checkmark-ring { - width: 32px; - height: 32px; - border-radius: 50%; - background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(16, 185, 129, 0.1) 100%); - border: 1px solid rgba(34, 197, 94, 0.3); - display: flex; - align-items: center; - justify-content: center; - flex-shrink: 0; - } - - .success-checkmark-inner { - width: 22px; - height: 22px; - border-radius: 50%; - background: linear-gradient(135deg, #22c55e 0%, #10b981 100%); - display: flex; - align-items: center; - justify-content: center; - } `; const badges = [ @@ -83,133 +40,52 @@ const badges = [ { icon: Link, text: 'Prompt URLs', variant: 'cyan' }, ]; -const isValidEmail = (email: string) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email); - export function HeroSection() { - const [email, setEmail] = useState(''); - const [isInvalid, setIsInvalid] = useState(false); - const [isSubmitted, setIsSubmitted] = useState(false); - const [showPopup, setShowPopup] = useState(false); - - const isEnabled = email.length > 0 && isValidEmail(email); - - const handleEmailChange = (e: React.ChangeEvent) => { - setEmail(e.target.value); - if (isInvalid) setIsInvalid(false); - }; - - const handleSubmit = async (e: React.FormEvent) => { - e.preventDefault(); - if (!isValidEmail(email)) { - setIsInvalid(true); - return; - } - setIsInvalid(false); - - // Fire and forget - don't block popup on logging failure - submitEmail(email).catch(console.error); - setShowPopup(true); - }; - - const handlePopupClose = () => { - setShowPopup(false); - setIsSubmitted(true); - }; - - const handleWaitlistSubmit = (data: { selected: string[]; other: string }) => { - // Fire and forget - don't block on logging failure - submitWaitlistData(email, data).catch(console.error); - }; - return ( <>