/**
 * Asset Variants List Page
 */

import { createListPage } from '../../factories/createListPage';
import TableAsset_variants from '../../components/Asset_variants/TableAsset_variants';
import {
  uploadCsv,
  setRefetch,
} from '../../stores/asset_variants/asset_variantsSlice';

import { Filter } from '../../types/filters';

const filters: Filter[] = [
  { label: 'CDNURL', title: 'cdn_url' },
  { label: 'Width(px)', title: 'width_px', number: true },
  { label: 'Height(px)', title: 'height_px', number: true },
  { label: 'Size(MB)', title: 'size_mb', number: true },
  { label: 'Asset', title: 'asset' },
  {
    label: 'Varianttype',
    title: 'variant_type',
    type: 'enum',
    options: [
      'thumbnail',
      'preview',
      'webp',
      'mp4_low',
      'mp4_high',
      'original',
    ],
  },
];

export default createListPage({
  entityName: 'asset_variants',
  entityTitle: 'Asset_variants',
  TableComponent: TableAsset_variants,
  filters,
  readPermission: 'READ_ASSET_VARIANTS',
  createPermission: 'CREATE_ASSET_VARIANTS',
  uploadCsvAction: uploadCsv,
  setRefetchAction: setRefetch,
});
