import React from 'react'; import googleMapsBrandIcon from '../../assets/google_maps_icon_2020.svg'; import googleMicBrandIcon from '../../assets/google_mic.svg'; import { EXPLORE_CATEGORIES } from '../../constants'; import type { TransitionId } from '../../navigation.declaration'; import { useMapStrings } from '../../hooks/useMapStrings'; export const ExploreSearchBar: React.FC<{ mapInstance: google.maps.Map | null; go: ( id: TransitionId, params?: Record, options?: { mode?: 'push' | 'replace'; popTo?: string; popToInclusive?: boolean; state?: unknown }, ) => void; /** 由父组件 `bindTap('profile.open')` 展开得到 */ profileTriggerProps: Record; searchNearby: (type: string) => void; }> = ({ mapInstance, go, profileTriggerProps, searchNearby }) => { const s = useMapStrings(); return (
Google Maps
{ const mc = mapInstance?.getCenter(); go( 'search.open', undefined, mc ? { state: { viewportCenter: { lat: mc.lat(), lng: mc.lng() } } } : undefined, ); }} > {s.search_placeholder}
{s.search_voice}
{EXPLORE_CATEGORIES.map((cat) => ( ))}
); };