/**
 * Users List Page
 */

import { createListPage } from '../../factories/createListPage';
import TableUsers from '../../components/Users/TableUsers';
import { uploadCsv, setRefetch } from '../../stores/users/usersSlice';

const filters = [
  { label: 'First Name', title: 'firstName' },
  { label: 'Last Name', title: 'lastName' },
  { label: 'Phone Number', title: 'phoneNumber' },
  { label: 'E-Mail', title: 'email' },
  { label: 'App Role', title: 'app_role' },
  { label: 'Custom Permissions', title: 'custom_permissions' },
];

export default createListPage({
  entityName: 'users',
  entityTitle: 'Users',
  TableComponent: TableUsers,
  filters,
  readPermission: 'READ_USERS',
  createPermission: 'CREATE_USERS',
  uploadCsvAction: uploadCsv,
  setRefetchAction: setRefetch,
  newItemLabel: 'Add/Invite User',
  cardBoxId: 'usersList',
});
