Feat/improve editable cell (#959)
* Removed isSomeInputInEditMode * Removed console.log * Added a first version of generic cell text * Removed metadata from entity table V1 * Fix * Fix * Fix
This commit is contained in:
38
front/src/modules/ui/table/components/EntityTableRowV2.tsx
Normal file
38
front/src/modules/ui/table/components/EntityTableRowV2.tsx
Normal file
@ -0,0 +1,38 @@
|
||||
import styled from '@emotion/styled';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
|
||||
import { entityFieldMetadataArrayState } from '../states/entityFieldMetadataArrayState';
|
||||
import { EntityFieldMetadataContext } from '../states/EntityFieldMetadataContext';
|
||||
|
||||
import { CheckboxCell } from './CheckboxCell';
|
||||
import { EntityTableCell } from './EntityTableCellV2';
|
||||
|
||||
const StyledRow = styled.tr<{ selected: boolean }>`
|
||||
background: ${(props) =>
|
||||
props.selected ? props.theme.background.secondary : 'none'};
|
||||
`;
|
||||
|
||||
export function EntityTableRow({ rowId }: { rowId: string }) {
|
||||
const entityFieldMetadataArray = useRecoilValue(
|
||||
entityFieldMetadataArrayState,
|
||||
);
|
||||
|
||||
return (
|
||||
<StyledRow data-testid={`row-id-${rowId}`} selected={false}>
|
||||
<td>
|
||||
<CheckboxCell />
|
||||
</td>
|
||||
{entityFieldMetadataArray.map((entityFieldMetadata, columnIndex) => {
|
||||
return (
|
||||
<EntityFieldMetadataContext.Provider
|
||||
value={entityFieldMetadata}
|
||||
key={entityFieldMetadata.fieldName}
|
||||
>
|
||||
<EntityTableCell cellIndex={columnIndex} />
|
||||
</EntityFieldMetadataContext.Provider>
|
||||
);
|
||||
})}
|
||||
<td></td>
|
||||
</StyledRow>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user