import type { Config } from '~/components/pub/my-ui/data-table'
import { defineAsyncComponent } from 'vue'
import { docTypeCode, docTypeLabel, type docTypeCodeKey } from '~/lib/constants'

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

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

  headers: [
    [
      { label: 'Nama Dokumen' },
      { label: 'Tipe Dokumen' },
      { label: 'Petugas Upload' },
      { label: 'Action' },
    ],
  ],

  keys: ['fileName', 'type_code', 'employee.name', 'action'],

  delKeyNames: [

  ],

  parses: {
    type_code: (v: unknown) => {
      return docTypeLabel[v?.type_code as docTypeCodeKey]
    },
  },

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

  htmls: {
  },
}
