import { Ionicons } from '@expo/vector-icons'; import { Pressable, StyleSheet, TextInput, View } from 'react-native'; import { colors } from '../../../src/theme'; interface Props { value: string; onChangeText: (t: string) => void; placeholder?: string; onClear?: () => void; } /** 带搜索图标与清除按钮的输入框 */ export function SearchInput({ value, onChangeText, placeholder = '搜索', onClear }: Props) { return ( {value.length > 0 ? ( ) : null} ); } const styles = StyleSheet.create({ box: { flexDirection: 'row', alignItems: 'center', gap: 8, height: 44, paddingHorizontal: 14, borderRadius: 12, borderWidth: 1, borderColor: colors.border, backgroundColor: colors.white, }, input: { flex: 1, fontSize: 15, color: colors.textPrimary }, });