Refactor/remove react table (#642)
* Refactored tables without tan stack * Fixed checkbox behavior with multiple handlers on click * Fixed hotkeys scope * Fix debounce in editable cells * Lowered coverage --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { useRecoilValue } from 'recoil';
|
||||
|
||||
import { TableColumn } from '@/people/table/components/peopleColumns';
|
||||
import { RecoilScope } from '@/recoil-scope/components/RecoilScope';
|
||||
import { isFetchingEntityTableDataState } from '@/ui/tables/states/isFetchingEntityTableDataState';
|
||||
import { RowContext } from '@/ui/tables/states/RowContext';
|
||||
import { tableRowIdsState } from '@/ui/tables/states/tableRowIdsState';
|
||||
|
||||
import { EntityTableRow } from './EntityTableRow';
|
||||
|
||||
export function EntityTableBody({ columns }: { columns: Array<TableColumn> }) {
|
||||
const rowIds = useRecoilValue(tableRowIdsState);
|
||||
|
||||
const isFetchingEntityTableData = useRecoilValue(
|
||||
isFetchingEntityTableDataState,
|
||||
);
|
||||
|
||||
return (
|
||||
<tbody>
|
||||
{!isFetchingEntityTableData ? (
|
||||
rowIds.map((rowId, index) => (
|
||||
<RecoilScope SpecificContext={RowContext} key={rowId}>
|
||||
<EntityTableRow columns={columns} rowId={rowId} index={index} />
|
||||
</RecoilScope>
|
||||
))
|
||||
) : (
|
||||
<tr>
|
||||
<td>loading...</td>
|
||||
</tr>
|
||||
)}
|
||||
</tbody>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user