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

const project = computed(() => parseInt(Array.isArray(route.params.projectId) ? '0' : route.params.projectId));

const { data: navigation, execute, status, error } = await useFetch(() => `/api/project/${project.value}/navigation`, {
    immediate: false,
});
</script>

<template>
    <div class="site-body-left-column">
        <div class="site-body-left-column-inner">
            <div class="nav-view-outer">
                <div class="nav-view">
                    <div class="tree-item">
                        <div class="tree-item-children">
                            <NavigationLink v-if="!!navigation" v-for="link of navigation" :project="project" :link="link" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>