'use client' import { useState } from 'react' interface Plan { id: string name: string description: string price: number currency: string interval: string features: { tasks: string taskDescription: string included: string[] highlighted?: boolean } popular?: boolean } const plans: Plan[] = [ { id: 'basic', name: 'Basic', description: 'Perfekt fuer den Einstieg', price: 9.90, currency: 'EUR', interval: 'Monat', features: { tasks: '30 Aufgaben', taskDescription: 'pro Monat', included: [ 'KI-gestuetzte Korrektur', 'Basis-Dokumentvorlagen', 'E-Mail Support', ], }, }, { id: 'standard', name: 'Standard', description: 'Fuer regelmaessige Nutzer', price: 19.90, currency: 'EUR', interval: 'Monat', popular: true, features: { tasks: '100 Aufgaben', taskDescription: 'pro Monat', included: [ 'Alles aus Basic', 'Eigene Vorlagen erstellen', 'Batch-Verarbeitung', 'Bis zu 3 Teammitglieder', 'Prioritaets-Support', ], highlighted: true, }, }, { id: 'premium', name: 'Premium', description: 'Sorglos-Tarif fuer Vielnutzer', price: 39.90, currency: 'EUR', interval: 'Monat', features: { tasks: 'Unbegrenzt', taskDescription: 'Fair Use', included: [ 'Alles aus Standard', 'Unbegrenzte Aufgaben (Fair Use)', 'Bis zu 10 Teammitglieder', 'Admin-Panel & Audit-Log', 'API-Zugang', 'Eigenes Branding', 'Dedizierter Support', ], }, }, ] export default function PricingSection() { const [selectedPlan, setSelectedPlan] = useState(null) const [isLoading, setIsLoading] = useState(false) const [email, setEmail] = useState('') const [showEmailForm, setShowEmailForm] = useState(false) const handleSelectPlan = (planId: string) => { setSelectedPlan(planId) setShowEmailForm(true) } const handleStartTrial = async (e: React.FormEvent) => { e.preventDefault() if (!selectedPlan || !email) return setIsLoading(true) try { // Call billing service to create checkout session const response = await fetch(`${process.env.NEXT_PUBLIC_BILLING_API_URL}/api/v1/billing/trial/start`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ plan_id: selectedPlan, email: email, }), }) const data = await response.json() if (data.checkout_url) { // Redirect to Stripe Checkout window.location.href = data.checkout_url } else { alert('Fehler beim Starten des Trials. Bitte versuchen Sie es erneut.') } } catch (error) { console.error('Error starting trial:', error) alert('Verbindungsfehler. Bitte versuchen Sie es erneut.') } finally { setIsLoading(false) } } return (
{/* Section Header */}

Waehlen Sie Ihren Plan

7 Tage kostenlos testen. Jederzeit kuendbar.

{/* Pricing Cards */}
{plans.map((plan) => (
{/* Popular Badge */} {plan.popular && (
Beliebteste Wahl
)} {/* Plan Header */}

{plan.name}

{plan.description}

{/* Price */}
{plan.price.toFixed(2).replace('.', ',')} EUR/{plan.interval}
{/* Tasks Highlight */}
{plan.features.tasks}
{plan.features.taskDescription}
{/* Features List */}
    {plan.features.included.map((feature, index) => (
  • {feature}
  • ))}
{/* CTA Button */}
))}
{/* Carryover Info */}

Ungenutzte Aufgaben sammeln sich bis zu 5 Monate an.
Keine versteckten Kosten. Kreditkarte fuer Trial erforderlich.

{/* Email Form Modal */} {showEmailForm && (

Trial starten

{plans.find((p) => p.id === selectedPlan)?.name} - 7 Tage kostenlos

Mit dem Fortfahren akzeptieren Sie unsere{' '} AGB und{' '} Datenschutzerklaerung.

)}
) }