import { BooleanField } from '@dvn/core/doldurma/src/fields/boolean';
import { DataTransferField } from '@dvn/core/doldurma/src/fields/query-include/data-transfer-field';
import { FormViewConfig } from '@dvn/core/models/form-view-config';
import { AppViewType } from '@dvn/core/models/view-config';
import { DeleteWhiteLabelFormHandler } from '../../handlers/DeleteWhiteLabelFormHandler';
import { dataConfigs } from '../data-configs';
import { spaces } from '../spaces';
export const ID = 'form-view-white-label-delete';
export const viewConfig = FormViewConfig.decode({
  _id: ID,
  base: 'mentornity',
  title: 'Deleting White Label',
  space: spaces['mentornity'],
  table: dataConfigs['whiteLabels'],
  type: AppViewType.FormView,
  handler: new DeleteWhiteLabelFormHandler(),
  ui: {
    fields: [
      // this field is passed by the parameters. this is a data holder field to pass the data to form handler
      {
        field: new DataTransferField('itemId'),
      },
      {
        field: new BooleanField('confirmation', 'Delete confirmation', 'Please confirm that you are aware of what you are doing. This action cannot be undone!').setErrorTitle('Confirmation').require(),
      },
    ],
  },
  params: {
    itemId: {
      required: true,
    },
  },
});
