<script lang="ts">
    import { navigations, currentLang } from "../../store"

    // import LanguageChooser from "./LanguageChooser.svelte"
    import NavigationItem from "./NavigationItem.svelte"

    export let ident = "main"
    export let mobile: boolean = false
    let navigation: Navigation

    $: {
        navigation = null
        $navigations?.map((nav) => {
            if (nav.ident === ident && nav.locale === $currentLang) {
                navigation = nav
            }
        })
    }
</script>

<!--<LanguageChooser />-->

{#if navigation}
    <nav class="{ident}" class:mobile>
        {#each navigation?.items || [] as item}
            <NavigationItem item="{item}" />
        {/each}
    </nav>
{/if}
