<script setup lang="ts">
function hideLeftPanel(_: Event)
{
    document?.querySelector('.published-container')?.classList.remove('is-left-column-open');
}

const route = useRoute();

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

const { data: navigation } = await useFetch(() => isNaN(project) ? '' : `/api/project/${project}/navigation`);
</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>