<template>
  <div class="min-h-[calc(100vh-9rem)] w-full">
    <ItemsHero v-if="hero" :data="hero" />
    <div class="container mx-auto py-12 px-2 min-h-[50vh] flex flex-col gap-2">
      <div v-for="item in content" class="contents">
        <DynamicZoneSection v-if="item.__component == 'dynamic-zone.section'" :data="item" />
        <DynamicZoneSpacer v-else-if="item.__component == 'dynamic-zone.spacer'" :data="item" />
        <DynamicZoneColumnImageText v-else-if="item.__component == 'dynamic-zone.column-image-text'" :data="item" />
        <DynamicZoneDualColumnText v-else-if="item.__component == 'dynamic-zone.dual-column-text'" :data="item" />
        <DynamicZoneFullImage v-else-if="item.__component == 'dynamic-zone.full-image'" :data="item" />
        <DynamicZoneFullText v-else-if="item.__component == 'dynamic-zone.full-text'" :data="item" />
        <DynamicZoneGallery v-else-if="item.__component == 'dynamic-zone.gallery'" :data="item" />
        <DynamicZoneFileDownload v-else-if="item.__component == 'dynamic-zone.file-download'" :data="item" />
        <DynamicZoneEmbedding v-else-if="item.__component == 'dynamic-zone.embedding'" :data="item" />
        <SharedList v-else-if="item.__component == 'shared.list'" :data="item" />
        <SharedEmphasiseArticle v-else-if="item.__component == 'shared.emphasise-article'" :data="item" />
        <br />
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import type { PropType } from "vue";
import type ItemsHero from "../types/component/items/hero";
import type { ComponentTypes } from "../types/component/baseComponent";

defineProps({
  hero: { type: Object as PropType<ItemsHero>, required: false, default: null },
  content: Array<ComponentTypes>,
});
</script>
