/**
 * Presigned URL Requests List Page
 */

import { createListPage } from '../../factories/createListPage';
import TablePresigned_url_requests from '../../components/Presigned_url_requests/TablePresigned_url_requests';
import {
  uploadCsv,
  setRefetch,
} from '../../stores/presigned_url_requests/presigned_url_requestsSlice';
import { Filter } from '../../types/filters';

const filters: Filter[] = [
  { label: 'Requestedkey', title: 'requested_key' },
  { label: 'MIMEtype', title: 'mime_type' },
  { label: 'Status', title: 'status' },
  { label: 'Requestedsize(MB)', title: 'requested_size_mb', number: true },
  { label: 'Expiresat', title: 'expires_at', date: true },
  { label: 'Project', title: 'project' },
  { label: 'User', title: 'user' },
  {
    label: 'Purpose',
    title: 'purpose',
    type: 'enum',
    options: ['upload', 'download'],
  },
  {
    label: 'Assettype',
    title: 'asset_type',
    type: 'enum',
    options: ['image', 'video', 'audio', 'file'],
  },
];

export default createListPage({
  entityName: 'presigned_url_requests',
  entityTitle: 'Presigned_url_requests',
  TableComponent: TablePresigned_url_requests,
  filters,
  readPermission: 'READ_PRESIGNED_URL_REQUESTS',
  createPermission: 'CREATE_PRESIGNED_URL_REQUESTS',
  uploadCsvAction: uploadCsv,
  setRefetchAction: setRefetch,
});
