import { DateField } from '@dvn/core/doldurma/src/fields/date';
import { TextField } from '@dvn/core/doldurma/src/fields/text';
import { Comparison } from '@dvn/core/models/filter';
import { TableListViewConfig } from '@dvn/core/models/table-list-view-config';
import { AppViewType } from '@dvn/core/models/view-config';
import { spaces } from '../spaces';
import { dataConfigs } from '../data-configs';
import { formTableListViewUIConfig } from './table-list-view-form-response-contact';
export const ID = 'table-list-view-form-response-help';
export const viewConfig = TableListViewConfig.decode({
  _id: ID,
  type: AppViewType.ListViewTable,
  base: 'mentornity',
  title: 'Help Forms',
  space: spaces['mentornity'],
  table: dataConfigs['formResponses'],
  query: {
    fields: [
      new DateField('createdAt', 'Created At'),
      new TextField('data', 'Data'),
      new TextField('type', 'type'),
    ],
    filter: {
      filters: [
        {
          comparison: Comparison.Eq,
          id: 'type',
          value: 'help',
        },
      ],
      operator: 'or'
    },
    sort: [{ id: 'createdAt', order: -1 }]
  },
  ui: formTableListViewUIConfig,
});
