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

const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dd.vue'))

export const config: Config = {
  cols: [
    { width: 120 }, // TGL. SEP
    { width: 150 }, // NO. SEP
    { width: 120 }, // PELAYANAN
    { width: 100 }, // JALUR
    { width: 150 }, // NO. RM
    { width: 200 }, // NAMA PASIEN
    { width: 150 }, // NO. KARTU BPJS
    { width: 150 }, // NO. SURAT KONTROL
    { width: 150 }, // TGL SURAT KONTROL
    { width: 150 }, // KLINIK TUJUAN
    { width: 200 }, // DPJP
    { width: 200 }, // DIAGNOSIS AWAL
    { width: 100 }, // AKSI
  ],

  headers: [
    [
      { label: 'TGL. SEP' },
      { label: 'NO. SEP' },
      { label: 'PELAYANAN' },
      { label: 'JALUR' },
      { label: 'NO. RM' },
      { label: 'NAMA PASIEN' },
      { label: 'NO. KARTU BPJS' },
      { label: 'NO. SURAT KONTROL' },
      { label: 'TGL SURAT KONTROL' },
      { label: 'KLINIK TUJUAN' },
      { label: 'DPJP' },
      { label: 'DIAGNOSIS AWAL' },
      { label: 'AKSI' },
    ],
  ],

  keys: [
    'letterDate',
    'letterNumber',
    'serviceType',
    'flow',
    'medicalRecordNumber',
    'patientName',
    'cardNumber',
    'controlLetterNumber',
    'controlLetterDate',
    'clinicDestination',
    'attendingDoctor',
    'diagnosis',
    'action',
  ],

  delKeyNames: [
    { key: 'letterNumber', label: 'NO. SEP' },
    { key: 'patientName', label: 'Nama Pasien' },
  ],

  parses: {},

  components: {
    action(rec, idx) {
      return {
        idx,
        rec: rec as object,
        component: action,
      }
    },
  },

  htmls: {},
}
