<script setup lang="ts">
const props = defineProps<{
  className?: string;
  selectType?: 'SELECT' | 'ALL';
}>();

const commonCodeStore = useCommonCodeStore();
const value = defineModel<string>('');

const { data, isLoading } = useQuery({
  queryKey: ['INST_CODE_LIST'],
  queryFn: async () => {
    return await commonCodeStore.searchInstCodeList();
  },
  staleTime: 60 * 1000,
  refetchOnWindowFocus: false,
  refetchOnMount: false
});
</script>

<template>
  <common-default-select-code
    v-if="!isLoading"
    :class-name="className"
    :select-type="selectType"
    :options="data"
    v-model="value"
  />
</template>
