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

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

export const config: Config = {
  cols: [{ width: 120 }, { }, { }, { width: 50 }],
  headers: [[{ label: 'Tanggal' }, { label: 'DPJP' }, { label: 'Alat Kesehatan' }, { label: '' }]],
  keys: ['createdAt', 'encounter.doctor.person.name', 'items', 'action'],
  delKeyNames: [
    { key: 'code', label: 'Kode' },
    { key: 'name', label: 'Nama' },
  ],
  skeletonSize: 10,
  htmls: {
    items: (rec: unknown): unknown => {
      const recX = rec as DeviceOrder
      return recX.items?.length || 0
    },
  }
  // funcParsed: {
  //   parent: (rec: unknown): unknown => {
  //     const recX = rec as SmallDetailDto
  //     return recX.parent?.name || '-'
  //   },
  // },
  // funcComponent: {
  //   action(rec: object, idx: any) {
  //     const res: RecComponent = {
  //       idx,
  //       rec: rec as object,
  //       component: action,
  //       props: {
  //         size: 'sm',
  //       },
  //     }
  //     return res
  //   },
  // }
}

