'use client' import React from 'react' import { Card, CardHeader, CardTitle, CardDescription } from '@/components/ui/card' import { Label } from '@/components/ui/label' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' import { Badge } from '@/components/ui/badge' import { CreditCard, Calendar, Check, ChevronLeft, ChevronRight, RefreshCw, ShoppingBag, CheckCircle2, } from 'lucide-react' import { motion, AnimatePresence } from 'framer-motion' interface StepBillingProps { selectedBillingInterval: 'one_time' | 'monthly' handleBillingIntervalChange: (val: 'one_time' | 'monthly') => void customerMode: 'select' | 'create' selectedEndCustomerId: string | null lastLicenseDate: string setLastLicenseDate: (date: string) => void prevStep: () => void nextStep: () => void } export function StepBilling({ selectedBillingInterval, handleBillingIntervalChange, lastLicenseDate, setLastLicenseDate, prevStep, nextStep, }: StepBillingProps) { const isOneTime = selectedBillingInterval === 'one_time' const isMonthly = selectedBillingInterval === 'monthly' return ( {/* ─── 1. FIXED HEADER (shrink-0) ─── */}
Abrechnungsmodell wählen Wählen Sie zwischen monatlicher Miete (Abonnement) oder einmaligem Softwarekauf.
Schritt 2 von 4
{/* ─── 2. NO-SCROLL MIDDLE CONTENT (flex-1 flex flex-col justify-center items-center overflow-hidden p-4) ─── */}
{/* Option 1: Miete / Abo */}
handleBillingIntervalChange('monthly')} className={`relative p-5 rounded-xl border-2 cursor-pointer transition-all duration-300 flex flex-col justify-between select-none ${ isMonthly ? 'border-primary bg-primary/10 shadow-[0_0_20px_rgba(59,130,246,0.2)] ring-1 ring-primary/50' : 'border-white/5 bg-white/5 hover:border-white/20 hover:bg-white/[0.07]' }`} >
{isMonthly && (
)}

Miete / Abo

Empfohlen

Fortlaufende monatliche Abrechnung

Maximale Flexibilität: Inklusive sämtlicher Software-Updates, Cloud-Dienste und Support. Jederzeit kündbar oder anpassbar.

Zahlungsintervall: monatlich
{/* Option 2: Kauf / Einmalkauf (mit integrierter Inline-Erweiterung) */}
handleBillingIntervalChange('one_time')} className={`relative p-5 rounded-xl border-2 cursor-pointer transition-all duration-300 flex flex-col justify-between select-none ${ isOneTime ? 'border-primary bg-primary/10 shadow-[0_0_20px_rgba(59,130,246,0.2)] ring-1 ring-primary/50' : 'border-white/5 bg-white/5 hover:border-white/20 hover:bg-white/[0.07]' }`} >
{isOneTime && (
)}

Kauf / Einmalkauf

Klassisch

Einmalige Lizenzgebühr

Dauerhafte Lizenzrechte für die gekaufte Version inklusive 12 Monate kostenfreier Updates.

{/* Inline-Erweiterung für Kaufdatum / Stichtag */} {isOneTime && ( e.stopPropagation()} >

Zur automatischen Berechnung der Update-Staffel (15% / 30% / 50%).

setLastLicenseDate(e.target.value)} className="bg-slate-900 border-white/10 text-white text-xs h-8 focus:border-primary w-full" />
{lastLicenseDate && (
Stichtag erfasst
)}
)}
Zahlungsintervall: einmalig
{/* ─── 3. FIXED BOTTOM ACTION BAR (shrink-0) ─── */}
{/* Back Button */} {/* Selected Model Status Chip */}
Gewähltes Modell: {isMonthly ? 'Monatliches Abo' : 'Einmaliger Kauf'}
{/* Next Button */}
) }