<script setup lang="ts">
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
import PaginationView from '~/components/pub/my-ui/pagination/pagination-view.vue'
import { config } from './list.cfg'
import { config as bpjsConfig } from './bpjs-list.cfg'

const props = withDefaults(defineProps<{
  data: any[]
  isBpjs?: boolean
}>(), {
  isBpjs: false,
})

const tableConfig = computed(() => {
  return props.isBpjs ? bpjsConfig : config
})
// const emit = defineEmits<{
//   pageChange: [page: number]
// }>()

// function handlePageChange(page: number) {
//   emit('pageChange', page)
// }
</script>

<template>
  <div class="space-y-4">
    <PubMyUiDataTable
      v-bind="tableConfig"
      :rows="data"
    />
    <!-- <PaginationView :pagination-meta="paginationMeta" @page-change="handlePageChange" /> -->
  </div>
</template>
