import type { Config } 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: 50 }],

  headers: [
    [
      { label: 'Nama' },
      { label: 'Cara Buat' },
      { label: 'Bentuk' },
      { label: 'Freq' },
      { label: 'Dosis' },
      // { label: 'Interval' },
      { label: 'Total' },
      { label: '' },
    ],
  ],

  keys: ['medicine.name', 'isMix', 'medicine.medicineForm.name', 'frequency', 'dose', 'quantity', 'action'], // 

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

  parses: {
    isMix: (rec: unknown): unknown => {
      return (rec as SmallDetailDto).isMix ? 'Racikan' : 'Non Racikan'
    },
  },

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

  htmls: {},
}
