import { View, Image, TouchableOpacity } from "react-native"; import { GooglePlacesAutocomplete } from "react-native-google-places-autocomplete"; import { icons } from "@/constants"; import { GoogleInputProps } from "@/types/type"; export const GoogleTextInput = ({ icon, initialLocation, containerStyles, textInputBackgroundColor, handlePress, }: GoogleInputProps) => { const googlePlacesApiKey = process.env.EXPO_PUBLIC_GOOGLE_API_KEY!; return ( { handlePress({ latitude: details?.geometry.location.lat!, longitude: details?.geometry.location.lng!, address: data.description, }); }} query={{ key: googlePlacesApiKey, language: "en", }} renderLeftButton={() => ( // TODO: replace later with View and remove onPress { handlePress({ latitude: 26.8467, longitude: 80.9462, address: "Lucknow, Uttar Pradesh", }); }} className="justify-center items-center w-6 h-6" > Search )} textInputProps={{ placeholderTextColor: "gray", placeholder: initialLocation ?? "Where do you want to go?", }} /> ); };