import React from 'react'; import { View, StyleSheet, FlatList, TouchableOpacity } from 'react-native'; import Text from '../atoms/Text'; import Avatar from '../atoms/Avatar'; export interface Creator { creatorId: string; description: string; name: string; profilePicture: string; systemPrompt: string; type: string; } interface CreatorSelectionSectionProps { authors: Creator[]; illustrators: Creator[]; selectedAuthor: Creator | null; selectedIllustrator: Creator | null; onSelectAuthor: (creator: Creator) => void; onSelectIllustrator: (creator: Creator) => void; } export default function CreatorSelectionSection({ authors, illustrators, selectedAuthor, selectedIllustrator, onSelectAuthor, onSelectIllustrator, }: CreatorSelectionSectionProps) { const renderCreatorItem = ( item: Creator, isSelected: boolean, onSelect: (creator: Creator) => void ) => ( onSelect(item)} > {item.name} ); return ( Autoren renderCreatorItem(item, selectedAuthor?.creatorId === item.creatorId, onSelectAuthor) } keyExtractor={(item) => item.creatorId} horizontal showsHorizontalScrollIndicator={false} style={styles.creatorList} contentContainerStyle={styles.creatorListContent} ListEmptyComponent={Keine Autoren verfügbar} /> Illustratoren renderCreatorItem( item, selectedIllustrator?.creatorId === item.creatorId, onSelectIllustrator ) } keyExtractor={(item) => item.creatorId} horizontal showsHorizontalScrollIndicator={false} style={styles.creatorList} contentContainerStyle={styles.creatorListContent} ListEmptyComponent={Keine Illustratoren verfügbar} /> ); } const styles = StyleSheet.create({ container: { marginTop: 16, }, creatorSectionTitle: { color: '#ffffff', fontSize: 18, fontWeight: '500', marginBottom: 12, marginTop: 16, }, creatorList: { marginBottom: 16, }, creatorListContent: { paddingRight: 20, }, creatorCard: { alignItems: 'center', marginRight: 12, opacity: 0.7, }, selectedCreator: { opacity: 1, }, creatorName: { color: '#ffffff', marginTop: 6, fontSize: 13, maxWidth: 80, textAlign: 'center', }, emptyListText: { color: '#999999', fontSize: 14, fontStyle: 'italic', padding: 20, }, });