From 3bb87e2806b27548f0393101c3b0561f8aeb2799 Mon Sep 17 00:00:00 2001 From: suryac Date: Wed, 5 Aug 2026 16:52:39 +0530 Subject: [PATCH] added pipeline version --- src/components/maps/DailyLogMap.tsx | 70 ++++++++++++++--------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/src/components/maps/DailyLogMap.tsx b/src/components/maps/DailyLogMap.tsx index eff87ee..c54f138 100644 --- a/src/components/maps/DailyLogMap.tsx +++ b/src/components/maps/DailyLogMap.tsx @@ -38,12 +38,12 @@ const mapContainerStyle = { const defaultCenter = { lat: 12.9716, lng: 77.5946 }; -export function DailyLogMap({ - latitude, +export function DailyLogMap({ + latitude, longitude, showStoreList = false -}: { - latitude?: number | string | null; +}: { + latitude?: number | string | null; longitude?: number | string | null; showStoreList?: boolean; }) { @@ -75,7 +75,7 @@ export function DailyLogMap({ 'groupid': '25', 'orgid': '57', 'templateid': '189', - 'x-pipeline-version': 'draft' + 'x-pipeline-version': 'latest' } ); @@ -90,13 +90,13 @@ export function DailyLogMap({ useEffect(() => { // If coords provided in props, use them if (latitude && longitude && String(latitude).trim() !== '—' && String(longitude).trim() !== '—') { - const lat = Number(latitude); - const lng = Number(longitude); - if (!isNaN(lat) && !isNaN(lng)) { - setUserLocation({ lat, lng }); - fetchNearestStores(lat, lng); - return; - } + const lat = Number(latitude); + const lng = Number(longitude); + if (!isNaN(lat) && !isNaN(lng)) { + setUserLocation({ lat, lng }); + fetchNearestStores(lat, lng); + return; + } } // Otherwise fallback to whatever tactic used for mobile @@ -125,12 +125,12 @@ export function DailyLogMap({ const bounds = new window.google.maps.LatLngBounds(); bounds.extend(userLocation); map.fitBounds(bounds); - + const listener = window.google.maps.event.addListener(map, 'idle', () => { - if (map.getZoom()! > 15) { - map.setZoom(15); - } - window.google.maps.event.removeListener(listener); + if (map.getZoom()! > 15) { + map.setZoom(15); + } + window.google.maps.event.removeListener(listener); }); } }, [userLocation]); @@ -232,24 +232,24 @@ export function DailyLogMap({ {showStoreList && (
-

- Nearby Stores -

-
- {stores.length > 0 ? ( - stores.map((store) => ( -
setSelectedStore(store)}> - {store.business_name} - {store.store_code} - {store.distance_km != null && ( - {store.distance_km.toFixed(2)} km away - )} -
- )) - ) : ( - No nearby stores found. - )} -
+

+ Nearby Stores +

+
+ {stores.length > 0 ? ( + stores.map((store) => ( +
setSelectedStore(store)}> + {store.business_name} + {store.store_code} + {store.distance_km != null && ( + {store.distance_km.toFixed(2)} km away + )} +
+ )) + ) : ( + No nearby stores found. + )} +
)}