import { useState } from "react";
import GoogleLocationSearch from "./locationSearch";

const MapSearchComponent = ({ onCloseModal }: any) => {
  const [selectedLocation, setSelectedLocation] =
    useState<google.maps.places.PlaceResult | null>(null);

  const handleSelectLocation: any = (place: google.maps.places.PlaceResult) => {
    setSelectedLocation(place);
  };

  return (
    <div>
      <GoogleLocationSearch
        onCloseModal={onCloseModal}
        onSelectLocation={handleSelectLocation}
      />
    </div>
  );
};

export default MapSearchComponent;
