import { Suspense, type MutableRefObject, type ReactNode } from 'react'; import type { FeatureFilters, FeatureMeta, POI, PostcodeGeometry, ViewState } from '../../../types'; import type { useMapData } from '../../../hooks/useMapData'; import type { TravelTimeEntry } from '../../../hooks/useTravelTime'; import type { SearchedLocation } from '../LocationSearch'; import MobileBottomSheet from '../MobileBottomSheet'; import { MapPinIcon } from '../../ui/icons/MapPinIcon'; import type { MapFlyTo } from './types'; import { MapFallback, PaneFallback } from './Fallbacks'; import { LoadingOverlay } from './LoadingOverlay'; import { Map, MobileDrawer } from './lazyComponents'; type MapData = ReturnType; type RightPaneTab = 'properties' | 'area'; interface MobileMapPageProps { initialLoading: boolean; mapData: MapData; pois: POI[]; mapViewFeature: string | null; filterRange: [number, number] | null; viewSource: 'drag' | 'eye' | null; onCancelPin: () => void; features: FeatureMeta[]; selectedHexagonId: string | null; hoveredHexagonId: string | null; onHexagonClick: (id: string, isPostcode?: boolean, geometry?: PostcodeGeometry) => void; onHexagonHover: (h3: string | null, x?: number, y?: number) => void; initialViewState: ViewState; flyToRef: MutableRefObject; theme: 'light' | 'dark'; filters: FeatureFilters; selectedPostcodeGeometry: PostcodeGeometry | null; onLocationSearched: (location: SearchedLocation | null) => void; onCurrentLocationFound: (lat: number, lng: number) => void; currentLocation: { lat: number; lng: number } | null; travelTimeEntries: TravelTimeEntry[]; bottomScreenInset: number; onBottomSheetCoveredHeightChange: (height: number) => void; mobileDrawerOpen: boolean; onMobileDrawerClose: () => void; onMobileDrawerPanelRectChange: (rect: DOMRectReadOnly) => void; rightPaneTab: RightPaneTab; onMobileDrawerTabChange: (tab: RightPaneTab) => void; poiPaneOpen: boolean; onTogglePoiPane: () => void; poiButtonLabel: string; poiPane: ReactNode; filtersPane: ReactNode; mobileLegend: ReactNode; renderAreaPane: () => ReactNode; renderPropertiesPane: () => ReactNode; toasts: ReactNode; upgradeModal: ReactNode; } export function MobileMapPage({ initialLoading, mapData, pois, mapViewFeature, filterRange, viewSource, onCancelPin, features, selectedHexagonId, hoveredHexagonId, onHexagonClick, onHexagonHover, initialViewState, flyToRef, theme, filters, selectedPostcodeGeometry, onLocationSearched, onCurrentLocationFound, currentLocation, travelTimeEntries, bottomScreenInset, onBottomSheetCoveredHeightChange, mobileDrawerOpen, onMobileDrawerClose, onMobileDrawerPanelRectChange, rightPaneTab, onMobileDrawerTabChange, poiPaneOpen, onTogglePoiPane, poiButtonLabel, poiPane, filtersPane, mobileLegend, renderAreaPane, renderPropertiesPane, toasts, upgradeModal, }: MobileMapPageProps) { return (
}>
{poiPaneOpen && (
{poiPane}
)} {filtersPane} {mobileDrawerOpen && selectedHexagonId && ( }> )} {toasts} {upgradeModal}
); }