/**
 * Project Audio Tracks List Page
 */

import { createListPage } from '../../factories/createListPage';
import TableProject_audio_tracks from '../../components/Project_audio_tracks/TableProject_audio_tracks';
import {
  uploadCsv,
  setRefetch,
} from '../../stores/project_audio_tracks/project_audio_tracksSlice';
import { Filter } from '../../types/filters';

const filters: Filter[] = [
  { label: 'Sourcekey', title: 'source_key' },
  { label: 'Name', title: 'name' },
  { label: 'Slug', title: 'slug' },
  { label: 'URL', title: 'url' },
  { label: 'Sortorder', title: 'sort_order', number: true },
  { label: 'Volume', title: 'volume', number: true },
  { label: 'Project', title: 'project' },
  {
    label: 'Environment',
    title: 'environment',
    type: 'enum',
    options: ['dev', 'stage', 'production'],
  },
];

export default createListPage({
  entityName: 'project_audio_tracks',
  entityTitle: 'Project_audio_tracks',
  TableComponent: TableProject_audio_tracks,
  filters,
  readPermission: 'READ_PROJECT_AUDIO_TRACKS',
  createPermission: 'CREATE_PROJECT_AUDIO_TRACKS',
  uploadCsvAction: uploadCsv,
  setRefetchAction: setRefetch,
});
