Fix EntriesItemTable & FloatingActions

This commit is contained in:
elforjani3
2020-10-27 19:39:15 +02:00
parent 0ec0865a6e
commit 8a830a0a97
20 changed files with 200 additions and 215 deletions

View File

@@ -0,0 +1,36 @@
import React, { useCallback, useMemo } from 'react';
import ItemListField from 'components/ItemListField';
import classNames from 'classnames';
import { FormGroup, Classes, Intent } from '@blueprintjs/core';
function ItemsListCell({
column: { id },
row: { index },
cell: { value: initialValue },
payload: { items, updateData, errors },
}) {
const handleItemSelected = useCallback(
(item) => {
updateData(index, id, item.id);
},
[updateData, index, id],
);
const error = errors?.[index]?.[id];
return (
<FormGroup
intent={error ? Intent.DANGER : null}
className={classNames('form-group--select-list', Classes.FILL)}
>
<ItemListField
items={items}
onItemSelected={handleItemSelected}
selectedItemId={initialValue}
/>
</FormGroup>
);
}
export default ItemsListCell;