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

type SmallDetailDto = any

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

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

  keys: ['name', 'uom_code', 'frequency', 'multiplier', 'interval', 'total'],

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

  parses: {
    cateogry: (rec: unknown): unknown => {
      return (rec as SmallDetailDto).medicineCategory?.name || '-'
    },
    group: (rec: unknown): unknown => {
      return (rec as SmallDetailDto).medicineGroup?.name || '-'
    },
    method: (rec: unknown): unknown => {
      return (rec as SmallDetailDto).medicineMethod?.name || '-'
    },
    unit: (rec: unknown): unknown => {
      return (rec as SmallDetailDto).medicineUnit?.name || '-'
    },
  },
}
