<template>
  <BaseMenuItem v-bind="$attrs"
                :label="label"
                :href="href"
                :to="to"
                :icon="icon"
  >
    <slot name="default"></slot>
  </BaseMenuItem>
</template>


<script setup>
import BaseMenuItem from "@/components/menu/BaseMenuItem.vue";
import { linkProps } from "@/components/link/link-props";
import { iconProps } from "@c/icon/ais-icons";
import { inject, onMounted } from "vue";

const registerMenuItem = inject('registerMenuItem', undefined)

const props = defineProps({
  ...linkProps,
  ...iconProps,
})

onMounted(() => {
  if(registerMenuItem !== undefined)
    registerMenuItem(props)
})
</script>

<script>
export default {
  name: "AisMenuItem"
}
</script>