import NoteTypeIcon from '../../components/Icons/NoteTypeIcon'
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
import ReloadIcon from '../../components/Icons/ReloadIcon'
import EditIcon from '../../components/Icons/EditIcon'

export const NoteType = {
  name: 'noteType',
  label: 'Note Type',
  prefix: 'NTY',
  icon: NoteTypeIcon,
  actions: [
    {
      name: 'info',
      label: 'Info',
      default: true,
      row: true,
      icon: InfoCircleIcon,
      url: (_id) => `/dashboard/management/notetypes/info?noteTypeId=${_id}`
    },
    {
      name: 'reload',
      label: 'Reload',
      icon: ReloadIcon,
      url: (_id) =>
        `/dashboard/management/notetypes/info?noteTypeId=${_id}&action=reload`
    },
    {
      name: 'edit',
      label: 'Edit',
      row: true,
      icon: EditIcon,
      url: (_id) =>
        `/dashboard/management/notetypes/info?noteTypeId=${_id}&action=edit`
    }
  ],
  columns: ['name', '_id', 'color', 'active', 'createdAt', 'updatedAt'],
  filters: ['name', '_id', 'color', 'active'],
  sorters: ['name', 'color', 'active', 'createdAt', 'updatedAt'],
  properties: [
    {
      name: '_id',
      label: 'ID',
      type: 'id',
      objectType: 'noteType',
      showCopy: true
    },
    {
      name: 'createdAt',
      label: 'Created At',
      type: 'dateTime',
      readOnly: true
    },
    {
      name: 'name',
      label: 'Name',
      required: true,
      type: 'text'
    },
    {
      name: 'updatedAt',
      label: 'Updated At',
      type: 'dateTime',
      readOnly: true
    },
    {
      name: 'color',
      label: 'Color',
      required: false,
      type: 'color'
    },
    {
      name: 'active',
      label: 'Active',
      required: true,
      type: 'bool'
    }
  ]
}
