"use client"; import dynamic from "next/dynamic"; import { Loader2, MapPinned } from "lucide-react"; /** * Leaflet reads `window` at module scope, so it cannot be evaluated during SSR. * `next/dynamic` with `ssr: false` keeps it out of the server bundle entirely — * this file is the client boundary that makes that possible (App Router only * allows `ssr: false` inside a Client Component). */ const PlantMap = dynamic(() => import("./PlantMap").then((m) => m.PlantMap), { ssr: false, loading: () => , }); function MapSkeleton() { return (

Loading map…

{Array.from({ length: 6 }).map((_, i) => (
))}
); } export function PlantMapLoader(props: React.ComponentProps) { return ; }