Newer
Older

Дмитрий Малюгин
committed
<script setup lang="ts">
import type { IEntity } from '@/app/interfaces/environment';
import type { IDivider, IImage, IParagraph } from '@/app/interfaces/entities';

Дмитрий Малюгин
committed
interface Props {
entity: IEntity;

Дмитрий Малюгин
committed
}
const props = defineProps<Props>();
const emit = defineEmits(['update:entityData']);
const entity = useVModel(props, 'entity', emit);

Дмитрий Малюгин
committed
</script>
<template>
<div>
<DividerItem
v-if="entity.entity_type === 'divider'"
:isEditMode="isEditMode"
/>
<TextItem
v-if="entity.entity_type === 'paragraph'"
:entityData="entity as IParagraph"
:isEditMode="isEditMode"
/>
<ImageItem
v-if="entity.entity_type === 'image'"
:isEditMode="isEditMode"
/>

Дмитрий Малюгин
committed
</div>
</template>
<style scoped></style>