import {
  createColumnLoader,
  ColumnMetadata,
} from '../DataGrid/configBuilderFactory';

const TOUR_PAGES_COLUMNS: ColumnMetadata[] = [
  {
    field: 'project',
    headerName: 'Project',
    type: 'singleSelectRelation',
    entityRef: 'projects',
    editable: true,
  },
  {
    field: 'environment',
    headerName: 'Environment',
    type: 'text',
    editable: true,
  },
  {
    field: 'source_key',
    headerName: 'Sourcekey',
    type: 'text',
    editable: true,
  },
  { field: 'name', headerName: 'Name', type: 'text', editable: true },
  { field: 'slug', headerName: 'Slug', type: 'text', editable: true },
  {
    field: 'sort_order',
    headerName: 'Sortorder',
    type: 'number',
    editable: true,
  },
  {
    field: 'background_image_url',
    headerName: 'BackgroundimageURL',
    type: 'text',
    editable: true,
  },
  {
    field: 'background_video_url',
    headerName: 'BackgroundvideoURL',
    type: 'text',
    editable: true,
  },
  {
    field: 'background_audio_url',
    headerName: 'BackgroundaudioURL',
    type: 'text',
    editable: true,
  },
  {
    field: 'background_loop',
    headerName: 'Backgroundloop',
    type: 'boolean',
    editable: true,
  },
  {
    field: 'requires_auth',
    headerName: 'Requiresauth',
    type: 'boolean',
    editable: true,
  },
  {
    field: 'ui_schema_json',
    headerName: 'UIschemaJSON',
    type: 'text',
    editable: true,
  },
  { field: 'actions', headerName: '', type: 'actions' },
];

export const loadColumns = createColumnLoader({
  entityName: 'tour_pages',
  columns: TOUR_PAGES_COLUMNS,
});
