import { defineComponent, h } from "vue"
import type { DefineComponent } from "vue"

const makeStub = (name: string): DefineComponent =>
  defineComponent({
    name,
    inheritAttrs: false,
    setup(_, { slots }) {
      return () =>
        h(
          "div",
          { [`data-stub-${name.toLowerCase()}`]: "" },
          slots.default?.(),
        )
    },
  }) as unknown as DefineComponent

export const LMap = makeStub("LMap")
export const LTileLayer = makeStub("LTileLayer")
export const LMarker = makeStub("LMarker")
export const LIcon = makeStub("LIcon")
export const LPopup = makeStub("LPopup")
export const LTooltip = makeStub("LTooltip")
export const LPolyline = makeStub("LPolyline")
export const LPolygon = makeStub("LPolygon")
export const LCircle = makeStub("LCircle")
export const LCircleMarker = makeStub("LCircleMarker")
export const LRectangle = makeStub("LRectangle")
export const LControl = makeStub("LControl")
export const LControlLayers = makeStub("LControlLayers")
export const LControlZoom = makeStub("LControlZoom")
export const LControlScale = makeStub("LControlScale")
export const LControlAttribution = makeStub("LControlAttribution")
export const LLayerGroup = makeStub("LLayerGroup")
export const LFeatureGroup = makeStub("LFeatureGroup")
export const LGeoJson = makeStub("LGeoJson")
export const LImageOverlay = makeStub("LImageOverlay")
export const LVideoOverlay = makeStub("LVideoOverlay")
