diff --git a/src/features/flights-map/index.ts b/src/features/flights-map/index.ts index 21076ff6..2c00ee73 100644 --- a/src/features/flights-map/index.ts +++ b/src/features/flights-map/index.ts @@ -1,2 +1,40 @@ // Public barrel for the flights-map feature. See frozen-barrels.md. -export {}; + +// 4A -- Types +export type { + FlightsMapSearchParams, + FlightsMapCalendarParams, + IFlightRoute, + IDestinationsResponse, + IFlightsMapDaysResponse, + IMapMarker, + IMapPolyline, + IMapPopup, + MarkerStyle, + PolylineStyle, + IFlightsMapFilterState, +} from "./types.js"; + +// 4A -- API functions +export { searchDestinations, getFlightsMapCalendar } from "./api.js"; + +// 4A -- React hooks +export { useFlightsMapSearch } from "./hooks/useFlightsMapSearch.js"; +export type { UseFlightsMapSearchResult } from "./hooks/useFlightsMapSearch.js"; +export { useFlightsMapCalendar } from "./hooks/useFlightsMapCalendar.js"; +export type { UseFlightsMapCalendarResult } from "./hooks/useFlightsMapCalendar.js"; +export { useFeatureFlag } from "./hooks/useFeatureFlag.js"; + +// 4D -- SEO builder functions +export { buildFlightsMapSeo } from "./seo.js"; +export type { TFunction } from "./seo.js"; + +// 4D -- JSON-LD builder functions +export { buildFlightsMapJsonLd } from "./json-ld.js"; + +// 4C -- Feature-specific page components +export { FlightsMapStartPage } from "./components/FlightsMapStartPage.js"; +export { FlightsMapFilter } from "./components/FlightsMapFilter.js"; +export type { FlightsMapFilterProps } from "./components/FlightsMapFilter.js"; +export { ClientOnly } from "./components/ClientOnly.js"; +export type { ClientOnlyProps } from "./components/ClientOnly.js"; diff --git a/src/mf/expose/FlightsMap.tsx b/src/mf/expose/FlightsMap.tsx index 48fa5b4d..eac615ee 100644 --- a/src/mf/expose/FlightsMap.tsx +++ b/src/mf/expose/FlightsMap.tsx @@ -1,17 +1,40 @@ -import type { HostContract } from "@/host-contract"; - /** * MF expose wrapper for the Flights Map feature. - * Phase 4 (flights-map port) replaces the body with the real root. + * + * Lazy-loads the FlightsMapStartPage via React.lazy + Suspense. + * Gated by the flightsMap feature flag. */ + +import { lazy, Suspense } from "react"; +import type { HostContract } from "@/host-contract"; +import { useFeatureFlag } from "@/features/flights-map/hooks/useFeatureFlag.js"; + +const FlightsMapStartPage = lazy(() => + import("@/features/flights-map/components/FlightsMapStartPage.js").then( + (m) => ({ default: m.FlightsMapStartPage }), + ), +); + export interface FlightsMapRemoteProps { hostContract: HostContract; } export default function FlightsMapRemote(_props: FlightsMapRemoteProps): JSX.Element { + const isEnabled = useFeatureFlag("flightsMap"); + + if (!isEnabled) { + return ( +
Flights Map is currently unavailable.
+Flights Map remote — stub. Populated in Phase 4.
+