<script lang="ts">
    import { jobOffers, modules, team } from "../../store"
    import Worldcard from "../widgets/Worldcard/worldcard.svelte"
    import Boxlist from "../widgets/boxlist.svelte"
    import ExtendableBox from "../widgets/extendableBox.svelte"
    import IconCycleBox from "../widgets/iconCycleBox.svelte"
    import IconCycleCircle from "../widgets/iconCycleCircle.svelte"
    import PageLinkBlocks from "../widgets/pageLinkBlocks.svelte"
    import Persons from "../widgets/persons.svelte"

    let col: { contentType: "moduleImport"; moduleImport: string }
    let pageId: string
    let bright: boolean
    let isHP: boolean
    let row: Row

    let module = $modules[col.moduleImport]
</script>

{#if module.type == "iconCycleCircle"}
    <IconCycleCircle iconCycleCircle="{module.iconCycleCircle}" pageId="{pageId}" />
{:else if module.type == "iconCycleSquare"}
    <IconCycleBox iconCycleSquare="{module.iconCycleSquare}" pageId="{pageId}" />
{:else if module.type == "worldCard"}
    <Worldcard worldCard="{module.worldCard}" pageId="{pageId}" />
{:else if module.type == "chefTeam"}
    <Persons persons="{Object.values($team).filter((p) => p.personType == 'chef')}" pageId="{pageId}" />
{:else if module.type == "employeeTeam"}
    <Boxlist persons="{Object.values($team).filter((p) => p.personType == 'employee')}" />
{:else if module.type == "jobOffer"}
    <ExtendableBox pages="{Object.values($jobOffers)}" />
{:else if module.type == "jobOfferLink"}
    <PageLinkBlocks pages="{Object.values($jobOffers)}" />
{/if}
