revops + onboarding

This commit is contained in:
Timo Knuth
2026-04-22 20:00:44 +02:00
parent ce724662d4
commit 7d2724b65d
37 changed files with 5073 additions and 1286 deletions

View File

@@ -1,9 +1,10 @@
'use client';
import React, { useState } from 'react';
import { Sparkles, Brain, TrendingUp, MessageSquare, Palette, ArrowRight, Mail, CheckCircle2, Lock } from 'lucide-react';
import Link from 'next/link';
import { motion } from 'framer-motion';
import React, { useState } from 'react';
import { Sparkles, Brain, TrendingUp, MessageSquare, Palette, ArrowRight, Mail, CheckCircle2, Lock } from 'lucide-react';
import Link from 'next/link';
import { motion } from 'framer-motion';
import { trackEvent } from '@/components/PostHogProvider';
const AIComingSoonBanner = () => {
const [email, setEmail] = useState('');
@@ -25,14 +26,21 @@ const AIComingSoonBanner = () => {
body: JSON.stringify({ email }),
});
const data = await response.json();
if (!response.ok) {
throw new Error(data.error || 'Failed to subscribe');
}
setSubmitted(true);
setEmail('');
const data = await response.json();
if (!response.ok) {
const errorMessage = typeof data?.error === 'string'
? data.error
: data?.details?.[0]?.message || 'Failed to subscribe';
throw new Error(errorMessage);
}
trackEvent('newsletter_subscribed', {
source: 'ai_coming_soon_banner',
already_subscribed: Boolean(data.alreadySubscribed),
});
setSubmitted(true);
setEmail('');
} catch (err) {
setError(err instanceof Error ? err.message : 'Something went wrong. Please try again.');
} finally {