import React from 'react'; import { View, Text } from 'react-native'; import { Ionicons } from '@expo/vector-icons'; import { useTheme } from '../../utils/ThemeContext'; import SubscriptionButton from './SubscriptionButton'; export interface SubscriptionPlanProps { id: string; name: string; price: number; priceUnit: string; priceBreakdown?: string; initialMana: number; dailyMana: number; maxMana: number; canGiftMana: boolean; popular?: boolean; billingCycle?: 'monthly' | 'yearly'; monthlyEquivalent?: number; } interface SubscriptionCardProps { plan: SubscriptionPlanProps; onSelect: (planId: string) => void; } export const SubscriptionCard: React.FC = ({ plan, onSelect }) => { const { theme } = useTheme(); const formatPrice = (price: number) => { return `${price.toFixed(2).replace('.', ',')}€`; }; return ( {plan.popular && ( Beliebt )} {/* Titel und Preis nebeneinander */} {plan.name} {formatPrice(plan.price)} {plan.priceUnit} {plan.priceBreakdown && ( {plan.priceBreakdown} )} {/* Beschreibungen in einer Komponente */} {/* Titel mit Icons */} Geschenk Regeneration Speicher {/* Tabellenwerte mit größeren Zahlen */} {plan.initialMana} {plan.dailyMana}/Tag Max. {plan.maxMana} {/* Mana verschenken Badge für bezahlte Pläne */} {plan.id !== 'free' && plan.canGiftMana && ( Mana verschenken möglich )} onSelect(plan.id)} iconName="chevron-forward" variant={plan.popular ? 'accent' : 'primary'} /> {/* Mana verschenken Info unter dem Button für Free-Tier */} {plan.id === 'free' && ( Im kostenlosen Plan ist das Verschenken von Mana nicht möglich. )} ); }; export default SubscriptionCard;