-
-
+
@@ -27,15 +18,7 @@ import type DynamicZoneFileDownload from "../../types/component/dynamic-zone/fil
const runtimeConfig = useRuntimeConfig();
const baseUrl = runtimeConfig.public.strapi.url;
-const props = defineProps({
+defineProps({
data: Object as PropType
,
});
-
-const showComponent = computed(() => {
- if (props.data?.file.mime == "application/pdf" || props.data?.file.mime.includes("image")) {
- return true;
- } else {
- return props.data?.enable_download;
- }
-});
diff --git a/components/dynamicZone/FileViewer.vue b/components/dynamicZone/FileViewer.vue
new file mode 100644
index 0000000..3f4813b
--- /dev/null
+++ b/components/dynamicZone/FileViewer.vue
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
diff --git a/types/component/baseComponent.ts b/types/component/baseComponent.ts
index f0d1395..ecae36c 100644
--- a/types/component/baseComponent.ts
+++ b/types/component/baseComponent.ts
@@ -9,6 +9,7 @@ import type DynamicZoneFileDownload from "./dynamic-zone/fileDownload";
import type DynamicZoneEmbedding from "./dynamic-zone/embedding";
import type DynamicZoneSection from "./dynamic-zone/section";
import type DynamicZoneSpacer from "./dynamic-zone/spacer";
+import type DynamicZoneFileViewer from "./dynamic-zone/fileViewer";
export default interface BaseComponent {
__component: ComponentNames;
@@ -25,6 +26,7 @@ export type ComponentNames =
| "dynamic-zone.full-image"
| "dynamic-zone.dual-column-text"
| "dynamic-zone.column-image-text"
+ | "dynamic-zone.file-viewer"
| "dynamic-zone.file-download"
| "dynamic-zone.embedding";
@@ -38,5 +40,6 @@ export type ComponentTypes =
| DynamicZoneFullImage
| DynamicZoneDualColumnText
| DynamicZoneColumnImageText
+ | DynamicZoneFileViewer
| DynamicZoneFileDownload
| DynamicZoneEmbedding;
diff --git a/types/component/dynamic-zone/fileDownload.ts b/types/component/dynamic-zone/fileDownload.ts
index 9a24e46..5bd9446 100644
--- a/types/component/dynamic-zone/fileDownload.ts
+++ b/types/component/dynamic-zone/fileDownload.ts
@@ -3,6 +3,5 @@ import type BaseFile from "../baseFile";
export default interface DynamicZoneFileDownload extends BaseComponent {
__component: "dynamic-zone.file-download";
- enable_download: boolean;
file: BaseFile;
}
diff --git a/types/component/dynamic-zone/fileViewer.ts b/types/component/dynamic-zone/fileViewer.ts
new file mode 100644
index 0000000..eb4d5c3
--- /dev/null
+++ b/types/component/dynamic-zone/fileViewer.ts
@@ -0,0 +1,7 @@
+import type BaseComponent from "../baseComponent";
+import type BaseFile from "../baseFile";
+
+export default interface DynamicZoneFileViewer extends BaseComponent {
+ __component: "dynamic-zone.file-viewer";
+ file: BaseFile;
+}