d70234f918
* Removed tanstack react table * Fixed remove table feature without tanstack table * Fixed delete people and companies * Fixed hotkeys on editable date cell * Fixed double text * Fixed company mock mode * Fixed lint * Fixed right click selection
30 lines
1013 B
TypeScript
30 lines
1013 B
TypeScript
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>
|
|
))
|
|
: null}
|
|
</tbody>
|
|
);
|
|
}
|