<template>
  <component :is="component" v-bind="props"/>
</template>

<script setup>
import {computed} from "vue";
import DCABuilder from "@/components/chart/DCABuilder.vue";
import LimitBuilder from "@/components/chart/LimitBuilder.vue";
import MarketBuilder from "@/components/chart/MarketBuilder.vue";
import DiagonalBuilder from "@/components/chart/DiagonalBuilder.vue";

const props = defineProps(['order', 'builder'])

const component = computed(()=>{
  switch (props.builder.component) {
    case 'MarketBuilder':
      return MarketBuilder
    case 'DCABuilder':
      return DCABuilder
    case 'LimitBuilder':
      return LimitBuilder
    case 'DiagonalBuilder':
      return DiagonalBuilder
    default:
      console.error('Unknown builder component '+props.builder.component)
      return null
  }
})
</script>

<style scoped lang="scss">

</style>