import { RowSelectionState } from '@tanstack/react-table'; import { RowsSelectionHandler, SortingState } from '../types'; /** * Custom hook to manage table state (selection, sorting) * Encapsulates all state-related logic for the DataTable component */ export default function useTableState(memoizedData: T[], rowKey?: keyof T, rowsSelection?: RowsSelectionHandler): { selectedRow: RowSelectionState; selectedRows: T[]; sorting: SortingState | undefined; setSorting: import('react').Dispatch>; handleRowSelectionChange: (updaterOrValue: RowSelectionState | ((old: RowSelectionState) => RowSelectionState)) => void; };