Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 1 addition & 23 deletions src/Shared/Components/Table/InternalTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { UseRegisterShortcutProvider } from '@Common/Hooks'

import { NO_ROWS_OR_GET_ROWS_ERROR } from './constants'
import TableContent from './TableContent'
import { FiltersTypeEnum, InternalTableProps, PaginationEnum, RowsResultType } from './types'
import { FiltersTypeEnum, InternalTableProps, RowsResultType } from './types'
import { getFilteringPromise, searchAndSortRows } from './utils'

const InternalTable = <
Expand Down Expand Up @@ -79,8 +79,6 @@ const InternalTable = <

const wrapperDivRef = useRef<HTMLDivElement>(null)

const { setIdentifiers } = bulkSelectionReturnValue ?? {}

const searchSortTimeoutRef = useRef<number>(-1)

useEffect(() => {
Expand Down Expand Up @@ -182,26 +180,6 @@ const InternalTable = <

const areFilteredRowsLoading = _areFilteredRowsLoading || filteredRowsError === NO_ROWS_OR_GET_ROWS_ERROR

const visibleRows = useMemo(() => {
const normalizedFilteredRows = filteredRows ?? []

const paginatedRows =
paginationVariant !== PaginationEnum.PAGINATED
? normalizedFilteredRows
: normalizedFilteredRows.slice(offset, offset + pageSize)

return paginatedRows
}, [paginationVariant, offset, pageSize, filteredRows])

useEffect(() => {
setIdentifiers?.(
visibleRows.reduce((acc, row) => {
acc[row.id] = row
return acc
}, {}),
)
}, [visibleRows])

const Wrapper = ViewWrapper ?? Fragment

const renderContent = () => {
Expand Down