<template>
  <component :is="componentRendered" :data="componentProp.content" />
</template>

<script>
export default {
  props: {
    componentProp: {
      type: Object
    }
  },

  computed: {
    componentRendered() {
      return this.componentProp.component_type.name
        ? () =>
            import(
              `@/components/DynamicComponents/${this.componentProp.component_type.name}`
            )
        : null
    }
  }
}
</script>