import type { Config } from '~/components/pub/my-ui/data-table'
import type { Patient } from '~/models/patient'

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

  headers: [
    [
      { label: 'Tanggal Order' },
      { label: 'No Lab' },
      { label: 'Nama Pemeriksaan' },
      { label: 'Tanggal Pemeriksaan' },
    ],
  ],

  keys: ['birth_date', 'person.name', 'person.name', 'birth_date',],

  parses: {
    birth_date: (rec: unknown): unknown => {
      const { person } = rec as Patient

      if (typeof person.birthDate == 'object' && person.birthDate) {
        return (person.birthDate as Date).toLocaleDateString('id-ID')
      } else if (typeof person.birthDate == 'string') {
        return (person.birthDate as string).substring(0, 10)
      }
      return person.birthDate
    },
  },

  components: {
  },

  htmls: {
    // patient_address(_rec) {
    //   return '-'
    // },
  },
}
