import { Ionicons } from '@expo/vector-icons'; import { memo, useState } from 'react'; import { Pressable, StyleSheet, TextInput, View } from 'react-native'; import Svg, { Path } from 'react-native-svg'; type HeaderProps = { onSearchChange?: (query: string) => void; }; export const Header = memo(function Header({ onSearchChange }: HeaderProps) { const [showSearch, setShowSearch] = useState(false); const [searchQuery, setSearchQuery] = useState(''); const handleSearchChange = (text: string) => { setSearchQuery(text); onSearchChange?.(text); }; const handleSearchToggle = () => { if (showSearch && searchQuery) { setSearchQuery(''); onSearchChange?.(''); } setShowSearch(!showSearch); }; return ( {showSearch ? ( ) : ( <> )} ); }); const styles = StyleSheet.create({ container: { flexDirection: 'row', alignItems: 'center', justifyContent: 'center', marginBottom: 0, marginTop: 14, paddingHorizontal: 16, }, logo: { width: 90, height: 18, }, searchButton: { position: 'absolute', right: 16, padding: 4, }, searchContainer: { flex: 1, flexDirection: 'row', alignItems: 'center', backgroundColor: '#1B1D24', borderRadius: 12, paddingHorizontal: 12, height: 28, gap: 8, }, searchInput: { flex: 1, color: '#F5F8FF', fontSize: 12, height: '100%', }, });