'use client'; import { Button } from '@/components/ui/button'; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from '@/components/ui/dialog'; import { cn } from '@/utils/cn'; import { useEffect, useState } from 'react'; interface JoinWaitlistProps { className?: string; } export function JoinWaitlist({ className }: JoinWaitlistProps) { const [value, setValue] = useState(''); const [open, setOpen] = useState(false); useEffect(() => { if (open) { // @ts-ignore window.op('event', 'waitlist_success'); } }, [open]); return ( <> Thanks so much! You're now on the waiting list. We'll let you know when we're ready. Should be within a month or two 🚀
{ e.preventDefault(); fetch('/api/waitlist', { method: 'POST', body: JSON.stringify({ email: value }), headers: { 'Content-Type': 'application/json', }, }).then((res) => { if (res.ok) { setOpen(true); } }); }} >
setValue(e.target.value)} />
); }