import type { Config } from '~/components/pub/my-ui/data-table'
import { defineAsyncComponent } from 'vue'

const SelectedRadio = defineAsyncComponent(() => import('~/components/pub/my-ui/data/select-radio.vue'))

export interface PatientData {
  id: string
  identity: string
  number: string
  bpjs: string
  name: string
}

export const config: Config = {
  cols: [{ width: 50 }, { width: 100 }, { width: 100 }, { width: 100 }, { width: 100 }],

  headers: [
    [{ label: '' }, { label: 'NO. KTP' }, { label: 'NO. RM' }, { label: 'NO. KARTU BPJS' }, { label: 'NAMA PASIEN' }],
  ],

  keys: ['check', 'identity', 'number', 'bpjs', 'name'],

  delKeyNames: [
    { key: 'code', label: 'Kode' },
    { key: 'name', label: 'Nama' },
  ],

  parses: {},

  components: {
    check(rec, idx) {
      return {
        idx,
        rec: { ...rec as object, menu: 'patient' },
        component: SelectedRadio,
      }
    },
  },

  htmls: {},
}
