import { createTableComponent } from '../Factory/createTableComponent';
import {
  fetch,
  update,
  deleteItem,
  setRefetch,
  deleteItemsByIds,
} from '../../stores/permissions/permissionsSlice';
import { loadColumns } from './configurePermissionsCols';
import type { PermissionEntity } from '../../types/entities';

const TablePermissions = createTableComponent<PermissionEntity>({
  entityName: 'permissions',
  sliceSelector: (state) => state.permissions,
  fetchAction: fetch,
  updateAction: update,
  deleteAction: deleteItem,
  deleteByIdsAction: deleteItemsByIds,
  setRefetchAction: setRefetch,
  loadColumnsFunction: loadColumns,
});

export default TablePermissions;
