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

const PWA_CACHES_COLUMNS: ColumnMetadata[] = [
  {
    field: 'project',
    headerName: 'Project',
    type: 'singleSelectRelation',
    entityRef: 'projects',
    editable: true,
  },
  {
    field: 'environment',
    headerName: 'Environment',
    type: 'text',
    editable: true,
  },
  {
    field: 'cache_version',
    headerName: 'Cacheversion',
    type: 'text',
    editable: true,
  },
  {
    field: 'manifest_json',
    headerName: 'ManifestJSON',
    type: 'text',
    editable: true,
  },
  {
    field: 'asset_list_json',
    headerName: 'AssetlistJSON',
    type: 'text',
    editable: true,
  },
  {
    field: 'generated_at',
    headerName: 'Generatedat',
    type: 'datetime',
    editable: true,
  },
  {
    field: 'is_active',
    headerName: 'Isactive',
    type: 'boolean',
    editable: true,
  },
  { field: 'actions', headerName: '', type: 'actions' },
];

export const loadColumns = createColumnLoader({
  entityName: 'pwa_caches',
  columns: PWA_CACHES_COLUMNS,
});
