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

type SmallDetailDto = any

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

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

  headers: [
    [
      { label: 'NO.' },
      { label: 'TANGGAL' },
      { label: 'SIKLUS' },
      { label: 'PERIODE KEMOTERAPI' },
      { label: 'KEHADIRAN' },
      { label: '' },
    ],
  ],

  keys: [
    'number',
    'tanggal',
    'siklus',
    'periode',
    'kehadiran',
    'action',
  ],

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

  parses: {
    parent: (rec: unknown): unknown => {
      const recX = rec as SmallDetailDto
      return recX.parent?.name || '-'
    },
  },

  components: {
    action(rec, idx) {
      const res: RecComponent = {
        idx,
        rec: rec as object,
        component: action,
      }
      return res
    },
  },

  htmls: {},
}
