<script>
    import NavbarMenu from "./NavbarMenu.svelte";
    import {getContext} from "svelte";

    export let schema;
    const channel = getContext("channel");
    const readableSchemas = getContext("readableSchemas");

    const fileSchemas = readableSchemas.filter((sc) => sc.type === "files");
    const otherSchemas = readableSchemas.filter((sc) => !sc.isEntry && sc.type === "collection");

</script>
<div class="sidebar-top">
    <a class="logo" href="{channel.lucentUrl}">{channel.name}</a>
    <a class="nav-item" href="{channel.lucentUrl}/profile">
    </a>
</div>
<div class="sidebar">


    <NavbarMenu
            title="Content"
            schemas={ readableSchemas.filter((sc) => sc.isEntry)}
            schema={schema}
            expanded={true}
    />

    <NavbarMenu
            title="Files"
            schemas={ fileSchemas}
            schema={schema}
    />

    <NavbarMenu
            title="Other"
            schemas={ otherSchemas}
            schema={schema}
    />
</div>
