import { View, Image } from "react-native"; import { GooglePlacesAutocomplete } from "react-native-google-places-autocomplete"; import { icons } from "@/constants"; import type { 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={() => ( Search )} textInputProps={{ placeholderTextColor: "gray", placeholder: initialLocation ?? "Where do you want to go?", }} /> ); };