import React from 'react'; import { View, Text, Pressable } from 'react-native'; import { useTheme } from '../theme/ThemeProvider'; import { useTranslation } from 'react-i18next'; import colors from '~/tailwind.config.js'; export type BillingCycle = 'monthly' | 'yearly'; interface BillingToggleProps { billingCycle: BillingCycle; onChange: (cycle: BillingCycle) => void; yearlyDiscount?: string; } export const BillingToggle: React.FC = ({ billingCycle, onChange, yearlyDiscount = '33%', }) => { const { isDark, themeVariant, tw } = useTheme(); const { t } = useTranslation(); // Theme-aware colors using the same system as MemoPreview and SettingsToggle const themeColors = (colors as any).theme?.extend?.colors; const textColor = isDark ? '#FFFFFF' : '#000000'; const secondaryTextColor = isDark ? 'rgba(255,255,255,0.7)' : 'rgba(0,0,0,0.7)'; const bgColor = isDark ? themeColors?.dark?.[themeVariant]?.contentBackground || '#1E1E1E' : themeColors?.[themeVariant]?.contentBackground || '#FFFFFF'; const borderColor = isDark ? themeColors?.dark?.[themeVariant]?.border || '#424242' : themeColors?.[themeVariant]?.border || '#e6e6e6'; const accentColor = '#4287f5'; // Konsistente Mana-Farbe const selectedBgColor = isDark ? 'rgba(255,255,255,0.1)' : 'rgba(0,0,0,0.06)'; return ( onChange('monthly')} > {t('subscription.monthly')} onChange('yearly')} > {t('subscription.yearly')} {yearlyDiscount && ( {t('subscription.yearly_discount', { percentage: yearlyDiscount })} )} ); }; export default BillingToggle;