export const MapExample: React.FC<HomePageMapProps> = ({ clientLocation }) => {

	const { current: currMap } = useMap();
  

	useEffect(() => {
	
		if (mapRef.current && clientLocation) {
		
			mapRef.current.flyTo({
		
				center: [clientLocation.long, clientLocation.lat],
		
				speed: 0.8,
		
				zoom: 10,
		
			});
		
		}
	
	}, [clientLocation]);

  

	return (
	
		<Map
		
			ref={mapRef}
			
			initialViewState={{
			
				zoom: 1,
			
			}}
		
			mapStyle="mapbox://styles/mapbox/streets-v11"
			
			mapboxAccessToken={MAPBOX_TOKEN}
			
			attributionControl={true}
			
			projection="globe"
		
>		
		
			{clientLocation && (
			
			<Marker
			
				longitude={clientLocation.long}
				
				latitude={clientLocation.lat}
				
				anchor="bottom"
			
    >			
			
			</Marker>
			
			)}
		
		</Map>
	
	);

};