/**
 * Page Links List Page
 */

import { createListPage } from '../../factories/createListPage';
import TablePage_links from '../../components/Page_links/TablePage_links';
import { uploadCsv, setRefetch } from '../../stores/page_links/page_linksSlice';
import { Filter } from '../../types/filters';

const filters: Filter[] = [
  { label: 'ExternalURL', title: 'external_url' },
  { label: 'Triggerselector', title: 'trigger_selector' },
  { label: 'Frompage', title: 'from_page' },
  { label: 'Topage', title: 'to_page' },
  { label: 'Transition', title: 'transition' },
  {
    label: 'Direction',
    title: 'direction',
    type: 'enum',
    options: ['forward', 'back', 'external'],
  },
];

export default createListPage({
  entityName: 'page_links',
  entityTitle: 'Page_links',
  TableComponent: TablePage_links,
  filters,
  readPermission: 'READ_PAGE_LINKS',
  createPermission: 'CREATE_PAGE_LINKS',
  uploadCsvAction: uploadCsv,
  setRefetchAction: setRefetch,
});
