import { jsx as _jsx } from "react/jsx-runtime";
import { ClientOnly } from "@arkyn/components";
import { MapPinned } from "lucide-react";
import { ClientMapView } from "./mapView.client";
import "./styles.css";
function EmptyMap({ className }) {
    return (_jsx("div", { className: "arkynMapViewPinnedEmpty " + className, children: _jsx(MapPinned, {}) }));
}
function MapView(props) {
    const { coordinates, zoom = 18, accessToken, className, onMarkerClick, ...rest } = props;
    if (!coordinates)
        return _jsx(EmptyMap, { className: className });
    const coordArray = Array.isArray(coordinates) ? coordinates : [coordinates];
    if (coordArray.length === 0)
        return _jsx(EmptyMap, { className: className });
    return (_jsx(ClientOnly, { fallback: _jsx(EmptyMap, { className: className }), children: () => (_jsx(ClientMapView, { accessToken: accessToken, coordinates: coordArray, center: coordArray[0], onMarkerClick: onMarkerClick, ...rest })) }));
}
export { MapView };
