import { DateField } from '@dvn/core/doldurma/src/fields/date';
import { DateDataType } from '@dvn/core/doldurma/src/fields/date/date';
import { DataTransferField } from '@dvn/core/doldurma/src/fields/query-include/data-transfer-field';
import { TableListViewConfig } from '@dvn/core/models/table-list-view-config';
import { AppViewType } from '@dvn/core/models/view-config';
import { dataConfigs } from '../data-configs';
import { spaces } from '../spaces';
export const ID = 'table-list-view-white-label';
export const viewConfig = TableListViewConfig.decode({
  _id: ID,
  type: AppViewType.ListViewTable,
  base: 'mentornity',
  title: 'White Labels',
  space: spaces['mentornity'],
  table: dataConfigs['whiteLabels'],
  query: {
    fields: [
      new DataTransferField('title'),
      new DataTransferField('domain'),
      new DataTransferField('createdAt'),
    ],
    sort: [{ id: 'title', order: 1 }]
  },
  ui: TableListViewConfig.decode({
    main: {
      fields: [
        { fieldId: 'title' },
        { fieldId: 'domain' },
        {
          fieldId: 'createdAt',
          fieldDisplay: new DateField('createdAt', 'Date').setDateFormat('DD MMM YYYY').setDataType(DateDataType.Unix),
        },
      ],
      columns: {
        domain: {
          weight: 1,
        },
        title: {
          weight: 1,
        },
        createdAt: {
          width: 150,
        },
      },
    },
  }),
});
