<template>
  <component v-bind="$attrs" :is="com_name" :search_type="search_type" />
</template>

<script setup lang="ts">
import { computed } from "vue";

import GloCustomerList from "../SearchObj/GloCustomerList.vue";
import GloClueList from "../SearchObj/GloClueList.vue";
import GloCompanyList from "../SearchObj/GloCompanyList.vue";

const SearchTypeEnum = {
  2: GloClueList,
  5: GloCompanyList,
  1: GloCustomerList,
  4: GloCustomerList,
};

interface Props {
  search_type: number;
}

const props = withDefaults(defineProps<Props>(), {
  search_type: 0,
});

const com_name = computed(() => {
  return SearchTypeEnum[props.search_type];
});
</script>
