import { View, Pressable, Switch } from 'react-native'; import { Text } from '../Text'; import { useTheme } from '~/contexts/ThemeContext'; import { useGenerationDefaults } from '~/store/generationDefaultsStore'; import { useModelSelection } from '~/store/modelStore'; import { aspectRatios } from '~/hooks/useImageGeneration'; import { Ionicons } from '@expo/vector-icons'; export function GenerationSettings() { const { theme } = useTheme(); const { defaultModelId, defaultAspectRatio, defaultImageCount, useAdvancedByDefault, setDefaultModel, setDefaultAspectRatio, setDefaultImageCount, setUseAdvancedByDefault, } = useGenerationDefaults(); const { models } = useModelSelection(); const selectedModel = models.find(m => m.id === defaultModelId); const selectedRatio = aspectRatios.find(r => r.value === defaultAspectRatio); return ( Voreinstellungen für neue Generierungen {/* Default Model */} Standard-Modell { // We'll cycle through models or show a picker const currentIndex = models.findIndex(m => m.id === defaultModelId); const nextIndex = (currentIndex + 1) % (models.length + 1); const nextModel = nextIndex === models.length ? null : models[nextIndex]; setDefaultModel(nextModel?.id || null); }} style={{ backgroundColor: theme.colors.input, borderRadius: 12, paddingHorizontal: 16, paddingVertical: 14, flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', }} > {selectedModel?.name || 'Kein Standard (manuell wählen)'} {/* Default Aspect Ratio */} Standard-Seitenverhältnis {aspectRatios.map(ratio => { const isSelected = ratio.value === defaultAspectRatio; return ( setDefaultAspectRatio(ratio.value)} style={{ paddingHorizontal: 14, paddingVertical: 8, borderRadius: 20, backgroundColor: isSelected ? theme.colors.primary.default : theme.colors.input, borderWidth: 1, borderColor: isSelected ? theme.colors.primary.default : theme.colors.border, }} > {ratio.label} ); })} {/* Default Image Count */} Standard-Anzahl Varianten {[1, 2, 3, 4].map(count => { const isSelected = count === defaultImageCount; return ( setDefaultImageCount(count)} style={{ flex: 1, paddingVertical: 10, borderRadius: 12, backgroundColor: isSelected ? theme.colors.primary.default : theme.colors.input, borderWidth: 1, borderColor: isSelected ? theme.colors.primary.default : theme.colors.border, alignItems: 'center', }} > {count} ); })} {/* Advanced Settings by Default */} Erweiterte Einstellungen immer anzeigen Zeigt erweiterte Optionen standardmäßig ausgeklappt ); }