<template>
  <component
    :is="
      descriptor.component ||
      getBindingByDescriptorType(descriptor.type).component
    "
    :descriptor="descriptor"
    v-bind="$attrs"
  />
</template>

<!-- eslint-disable-next-line vue/block-lang - we want this to be working with JS projects too -->
<script>
import { defineComponent } from 'vue';
import { getBindingByDescriptorType } from './helpers/bindings';
import { getDescriptorProps } from './helpers/component';

export default defineComponent({
  name: 'LxResolver',
  inheritAttrs: false,
  props: getDescriptorProps(),
  setup() {
    return { getBindingByDescriptorType };
  },
});
</script>
