<script>
    import Members from "./members/Members.svelte";
    import RecordNotFound from "./records/NotFound.svelte";
    import RecordEdit from "./records/Edit.svelte";
    import ContentIndex from "./content/Index.svelte";
    import {setContext} from "svelte";
    import Navbar from "./Navbar.svelte";
    import HomeIndex from "./home/Index.svelte";

    const components = {
        members: Members,
        recordEdit: RecordEdit,
        recordNotFound: RecordNotFound,
        contentIndex: ContentIndex,
        homeIndex: HomeIndex,
    };

    export let title;
    export let view;
    export let user;
    export let data;
    export let layout;
    export let channel;


    setContext("channel", channel);
    setContext("user", user);

</script>

<Navbar schema={data.schema}/>

<svelte:component this={components[view]} {title} {...data}/>

