<script setup lang="ts">
import { computed } from 'vue'
import EarlyEntry from './early-entry.vue'
import EarlyRehabEntry from './early-rehab-entry.vue'
import FunctionEntry from './function-entry.vue'

/**
 * Props:
 * - excludeFields: daftar nama field yang ingin disembunyikan
 */
const props = defineProps<{
  type: 'early' | 'early-rehab' | 'function'
  excludeFields?: string[]
}>()

const componentMap = {
  early: EarlyEntry,
  'early-rehab': EarlyRehabEntry,
  function: FunctionEntry,
}

// Komponen aktif berdasarkan type
const ActiveComponent = computed(() => componentMap[props.type])
</script>

<template>
  <component :is="ActiveComponent" :exclude-fields="excludeFields" />
</template>
