/**
 * Project Audio Tracks Table Component
 */

import React from 'react';
import GenericTable from '../Generic/GenericTable';
import {
  fetch,
  update,
  deleteItem,
  setRefetch,
  deleteItemsByIds,
} from '../../stores/project_audio_tracks/project_audio_tracksSlice';
import { loadColumns } from './configureProject_audio_tracksCols';
import type { ProjectAudioTrack } from '../../types/entities';
import type { RootState } from '../../stores/store';
import type { Filter, FilterItem } from '../../types/filters';

interface TableProject_audio_tracksProps {
  filterItems: FilterItem[];
  setFilterItems: (items: FilterItem[]) => void;
  filters: Filter[];
  showGrid?: boolean;
}

const TableProject_audio_tracks: React.FC<TableProject_audio_tracksProps> = ({
  filterItems,
  setFilterItems,
  filters,
}) => {
  return (
    <GenericTable<ProjectAudioTrack>
      entityName='project_audio_tracks'
      sliceSelector={(state: RootState) => state.project_audio_tracks}
      fetchAction={fetch}
      updateAction={update}
      deleteAction={deleteItem}
      deleteByIdsAction={deleteItemsByIds}
      setRefetchAction={setRefetch}
      loadColumnsFunction={loadColumns}
      filters={filters}
      filterItems={filterItems}
      setFilterItems={setFilterItems}
    />
  );
};

export default TableProject_audio_tracks;
