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

export const DocumentSize = {
  name: 'documentSize',
  label: 'Document Size',
  prefix: 'DSZ',
  icon: DocumentSizeIcon,
  actions: [
    {
      name: 'info',
      label: 'Info',
      default: true,
      row: true,
      icon: InfoCircleIcon,
      url: (_id) =>
        `/dashboard/management/documentsizes/info?documentSizeId=${_id}`
    },

    {
      name: 'reload',
      label: 'Reload',
      icon: ReloadIcon,
      url: (_id) =>
        `/dashboard/management/documentsizes/info?documentSizeId=${_id}&action=reload`
    },
    {
      name: 'edit',
      label: 'Edit',
      row: true,
      icon: EditIcon,
      url: (_id) =>
        `/dashboard/management/documentsizes/info?documentSizeId=${_id}&action=edit`
    }
  ],
  columns: ['name', '_id', 'width', 'height', 'createdAt', 'updatedAt'],
  filters: ['name', '_id', 'width', 'height'],
  sorters: ['name', 'width', 'height', 'createdAt', 'updatedAt'],
  properties: [
    {
      name: '_id',
      label: 'ID',
      type: 'id',
      objectType: 'documentSize',
      showCopy: true
    },
    {
      name: 'createdAt',
      label: 'Created At',
      type: 'dateTime',
      readOnly: true
    },
    {
      name: 'name',
      label: 'Name',
      required: true,
      type: 'text',
      columnWidth: 200,
      columnFixed: 'left'
    },
    {
      name: 'updatedAt',
      label: 'Updated At',
      type: 'dateTime',
      readOnly: true
    },
    {
      name: 'width',
      label: 'Width',
      required: true,
      columnWidth: 150,
      type: 'number',
      suffix: 'mm'
    },
    {
      name: 'height',
      label: 'Height',
      required: true,
      columnWidth: 150,
      type: 'number',
      suffix: 'mm'
    }
  ]
}
