<script setup lang="ts">
import AsideMenuItem from '@/Components/AsideMenuItem.vue';

defineProps({
    isDropdownList: Boolean,
    menu: {
        type: Object,
        default: () => {},
    },
});

const emit = defineEmits(['menu-click']);

const menuClick = (event, item) => {
    emit('menu-click', event, item);
};
</script>

<template>
    <ul>
        <AsideMenuItem
            v-for="(item, index) in menu"
            :key="index"
            v-bind:item="item"
            :is-dropdown-list="item.children?.length > 0"
            @menu-click="menuClick"
        />
    </ul>
</template>
