embedding

This commit is contained in:
Julian Krauser 2025-01-18 11:39:03 +01:00
parent 9d81666a3c
commit 69fd756a5a
5 changed files with 29 additions and 3 deletions

View file

@ -10,6 +10,7 @@
<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" />
<br />
</div>

View file

@ -0,0 +1,15 @@
<template>
<div class="flex flex-col gap-2 w-full min-h-fit max-w-4xl mx-auto">
<h1 class="text-center">{{ data.title }}</h1>
<iframe :src="data.link" class="w-full h-[90vh]"></iframe>
</div>
</template>
<script setup lang="ts">
import type { PropType } from "vue";
import type DynamicZoneEmbedding from "../../types/component/dynamicZoneEmbedding";
const props = defineProps({
data: Object as PropType<DynamicZoneEmbedding>,
});
</script>

View file

@ -1,6 +1,6 @@
<template>
<div v-if="showComponent" class="flex flex-col gap-2 w-full min-h-fit max-w-4xl mx-auto">
<h1 class="text-center">{{ data?.title }}</h1>
<h1 class="text-center">{{ data.title }}</h1>
<iframe v-if="data.file.mime == 'application/pdf'" :src="baseUrl + data.file.url" class="w-full h-[90vh]"></iframe>
<NuxtPicture
v-if="data.file.mime.includes('image')"

View file

@ -6,6 +6,7 @@ import type DynamicZoneFullText from "./dynamicZoneFullText";
import type DynamicZoneGallery from "./dynamicZoneGallery";
import type DynamicZoneFileDownload from "./dynamicZoneFileDownload";
import type SharedList from "./sharedList";
import type DynamicZoneEmbedding from "./dynamicZoneEmbedding";
export default interface BaseComponent {
__component: ComponentNames;
@ -20,7 +21,8 @@ export type ComponentNames =
| "dynamic-zone.emphasise-article"
| "dynamic-zone.dual-column-text"
| "dynamic-zone.column-image-text"
| "dynamic-zone.file-download";
| "dynamic-zone.file-download"
| "dynamic-zone.embedding";
export type ComponentTypes =
| SharedList
@ -30,4 +32,5 @@ export type ComponentTypes =
| DynamicZoneEmphasiseArticle
| DynamicZoneDualColumnText
| DynamicZoneColumnImageText
| DynamicZoneFileDownload;
| DynamicZoneFileDownload
| DynamicZoneEmbedding;

View file

@ -0,0 +1,7 @@
import type BaseComponent from "./baseComponent";
export default interface DynamicZoneEmbedding extends BaseComponent {
__component: "dynamic-zone.embedding";
title: string;
link: string;
}