+
+ {label}
+
+
+
{plan ? _t(plan.title) : sub.planKey}
+
+ {isActive && !sub.recurring && (
+ Gekündigt
+ )}
+ {statusInfo.label}
+
+
+
+ {isPending && (
+
+ {justPaid
+ ? 'Zahlung erfolgreich. Abonnement wird aktiviert — bitte warten...'
+ : 'Die Zahlung wurde noch nicht abgeschlossen. Sie können den Checkout abbrechen oder erneut starten.'}
+
+ )}
+
+ {isScheduled && sub.effectiveFrom && (
+
+ Dieses Abonnement wird am {_formatDate(sub.effectiveFrom)} aktiv, wenn das aktuelle Abonnement ausläuft.
+
+ )}
+
+ {!isPending && !isScheduled && (
+
+ Gestartet: {_formatDate(sub.startedAt)}
+ {plan && Periode: {_periodLabel[plan.billingPeriod] || '—'} }
+ {sub.currentPeriodEnd && Periodenende: {_formatDate(sub.currentPeriodEnd)} }
+ {sub.trialEndsAt && Trial endet: {_formatDate(sub.trialEndsAt)} }
+ {isActive && !sub.recurring && sub.currentPeriodEnd && (
+ Läuft aus am: {_formatDate(sub.currentPeriodEnd)}
+ )}
+
+ )}
+
+
+ {isActive && !sub.recurring && onReactivate && (
+ onReactivate(sub.id)}
+ disabled={reactivating}
+ style={{
+ padding: '6px 14px', borderRadius: '6px', border: 'none',
+ background: 'var(--color-primary, #3b82f6)', color: '#fff',
+ fontWeight: 600, cursor: reactivating ? 'wait' : 'pointer', fontSize: '0.85rem',
+ }}
+ >
+ {reactivating ? 'Wird reaktiviert...' : 'Reaktivieren'}
+
+ )}
+
+ {isActive && sub.recurring && onCancel && (
+ onCancel(sub.id)}
+ disabled={cancelling}
+ style={{
+ padding: '6px 14px', borderRadius: '6px',
+ border: '1px solid #ef4444', background: 'transparent',
+ color: '#ef4444', fontWeight: 500,
+ cursor: cancelling ? 'wait' : 'pointer', fontSize: '0.85rem',
+ }}
+ >
+ {cancelling ? 'Wird gekündigt...' : 'Kündigen'}
+
+ )}
+
+ {(isPending || isScheduled) && onCancel && (
+ onCancel(sub.id)}
+ disabled={cancelling}
+ style={{
+ padding: '6px 14px', borderRadius: '6px',
+ border: '1px solid #ef4444', background: 'transparent',
+ color: '#ef4444', fontWeight: 500,
+ cursor: cancelling ? 'wait' : 'pointer', fontSize: '0.85rem',
+ }}
+ >
+ {cancelling ? 'Wird abgebrochen...' : 'Abbrechen'}
+
+ )}
+
+
+ );
+};
+
+// ============================================================================
+// Subscription Tab
+// ============================================================================
+
+interface SubscriptionTabProps {
+ mandateId: string;
+}
+
+export const SubscriptionTab: React.FC