import { createTableComponent } from '../Factory/createTableComponent';
import {
  fetch,
  update,
  deleteItem,
  setRefetch,
  deleteItemsByIds,
} from '../../stores/projects/projectsSlice';
import { loadColumns } from './configureProjectsCols';
import type { Project } from '../../types/entities';

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

export default TableProjects;
