import styles from "@/app/tabStyles/indexStyles"; import React from "react"; import { Text, View, TextInput, FlatList, TouchableOpacity, Keyboard, TouchableWithoutFeedback, } from "react-native"; import Feather from "@expo/vector-icons/Feather"; import { useDiscoveryContext } from "@/contexts/DiscoveryContext"; import { useShowContext } from "@/contexts/ShowContext"; export default function TabTwoScreen() { const { query, setQuery, suggestions, loading, error, clear } = useDiscoveryContext(); const { shows } = useShowContext(); const personSuggestions = React.useMemo( () => suggestions.filter((s) => s.type === "PERSON"), [suggestions] ); const showSuggestions = React.useMemo( () => suggestions.filter((s) => s.type === "SHOW"), [suggestions] ); const [tag, setTag] = React.useState(null); return ( Durchsuchen { console.log("Search:", query); }} autoCapitalize="none" /> {query.length === 0 ? ( ) : ( setQuery("")} /> )} {tag && ( {tag} setTag(null)} style={{ marginLeft: "auto", marginRight: 10 }} /> )} {query.length > 0 && ( <> Suchvorschläge {showSuggestions.map((suggestion, idx) => ( { setTag(suggestion.text); }} > {suggestion.text} ))} {personSuggestions.map((suggestion, idx) => ( { setTag(suggestion.text); }} > {suggestion.text} ))} )} ); }