import { createTableComponent } from '../Factory/createTableComponent';
import {
  fetch,
  update,
  deleteItem,
  setRefetch,
  deleteItemsByIds,
} from '../../stores/assets/assetsSlice';
import { loadColumns } from './configureAssetsCols';
import type { Asset } from '../../types/entities';

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

export default TableAssets;
