53 lines
1.1 KiB
TypeScript
53 lines
1.1 KiB
TypeScript
import React from "react";
|
|
import { StyleSheet, TextInput, View } from "react-native";
|
|
import { Ionicons } from "@expo/vector-icons";
|
|
import { Colors } from "@/theme";
|
|
|
|
export function SearchHeader({
|
|
value,
|
|
onChangeText,
|
|
placeholder = "Search…",
|
|
}: {
|
|
value: string;
|
|
onChangeText: (v: string) => void;
|
|
placeholder?: string;
|
|
}) {
|
|
return (
|
|
<View style={styles.container}>
|
|
<View style={styles.searchBox}>
|
|
<Ionicons name="search" size={18} color={Colors.primaryDark} />
|
|
<TextInput
|
|
value={value}
|
|
onChangeText={onChangeText}
|
|
placeholder={placeholder}
|
|
placeholderTextColor={Colors.textSecondary}
|
|
autoCorrect={false}
|
|
style={styles.input}
|
|
/>
|
|
</View>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
padding: 12,
|
|
},
|
|
searchBox: {
|
|
flexDirection: "row",
|
|
alignItems: "center",
|
|
gap: 8,
|
|
borderWidth: 1,
|
|
borderColor: Colors.border,
|
|
borderRadius: 10,
|
|
paddingHorizontal: 12,
|
|
backgroundColor: "#FAFAFA",
|
|
},
|
|
input: {
|
|
flex: 1,
|
|
paddingVertical: 10,
|
|
fontSize: 16,
|
|
color: Colors.textPrimary,
|
|
},
|
|
});
|