/**
 * PWA Caches List Page
 */

import { createListPage } from '../../factories/createListPage';
import TablePwa_caches from '../../components/Pwa_caches/TablePwa_caches';
import { uploadCsv, setRefetch } from '../../stores/pwa_caches/pwa_cachesSlice';
import { Filter } from '../../types/filters';

const filters: Filter[] = [
  { label: 'Cacheversion', title: 'cache_version' },
  { label: 'ManifestJSON', title: 'manifest_json' },
  { label: 'AssetlistJSON', title: 'asset_list_json' },
  { label: 'Generatedat', title: 'generated_at', date: true },
  { label: 'Project', title: 'project' },
  {
    label: 'Environment',
    title: 'environment',
    type: 'enum',
    options: ['stage', 'production'],
  },
];

export default createListPage({
  entityName: 'pwa_caches',
  entityTitle: 'Pwa_caches',
  TableComponent: TablePwa_caches,
  filters,
  readPermission: 'READ_PWA_CACHES',
  createPermission: 'CREATE_PWA_CACHES',
  uploadCsvAction: uploadCsv,
  setRefetchAction: setRefetch,
});
