<script setup lang="ts">
const route = useRoute();

const project = computed(() => parseInt(route.params.projectId as string));

const { data: navigation, refresh } = await useLazyFetch(() => `/api/project/${project.value}/navigation`, { immediate: false });

if(!isNaN(project.value))
{
    await refresh();
}
</script>

<template>
    <div class="tree-item">
        <div class="tree-item-children">
            <NavigationLink v-if="!!navigation" v-for="link of navigation" :project="project" :link="link" />
        </div>
    </div>
</template>