import React, { ReactNode, useState } from 'react'; import { View, ScrollView, ActivityIndicator, TouchableOpacity } from 'react-native'; import { Ionicons } from '@expo/vector-icons'; import { Text } from './Text'; import { Button } from './Button'; import { useTheme } from '~/contexts/ThemeContext'; export type OptionItem = { id: string; label: string; subtitle?: string; icon?: string; description?: string; }; type OptionSelectorProps = { options: OptionItem[]; selectedId: string | null; onSelect: (option: OptionItem) => void; loading?: boolean; error?: string | null; onRetry?: () => void; disabled?: boolean; minWidth?: number; title?: string; }; export function OptionSelector({ options, selectedId, onSelect, loading = false, error = null, onRetry, disabled = false, minWidth = 160, title, }: OptionSelectorProps) { const { theme } = useTheme(); const [showInfo, setShowInfo] = useState(false); // Loading state if (loading) { return ( Lade... ); } // Error state if (error || options.length === 0) { return ( {error || 'Keine Optionen verfügbar'} {onRetry && (