"use client";

import dynamic from "next/dynamic";
import { MapPin } from '@/lib/icons';

const Inner = dynamic(
  () =>
    import("./property-map-picker-inner").then((m) => m.PropertyMapPickerInner),
  {
    ssr: false,
    loading: () => (
      <div className="flex h-64 w-full items-center justify-center rounded-lg border bg-muted/30">
        <div className="flex items-center gap-2 text-sm text-muted-foreground">
          <MapPin className="size-4 animate-pulse" />
          Harita yükleniyor...
        </div>
      </div>
    ),
  },
);

interface Props {
  initialLat?: number | null;
  initialLng?: number | null;
  initialSearchQuery?: string;
  onLocationChange: (lat: number, lng: number) => void;
  onClear: () => void;
}

export function PropertyMapPicker(props: Props) {
  return <Inner {...props} />;
}
