|
@@ -1,9 +1,7 @@
|
|
|
-import { useCell } from '../_shared/database-hooks/useCell';
|
|
|
import { CellIdentifier } from '../../stores/effects/database/cell/cell_bd_svc';
|
|
|
import { CellCache } from '../../stores/effects/database/cell/cell_cache';
|
|
|
import { FieldController } from '../../stores/effects/database/field/field_controller';
|
|
|
-import { useEffect } from 'react';
|
|
|
-import { DateCellDataPB, FieldType, SelectOptionCellDataPB } from '../../../services/backend';
|
|
|
+import { FieldType } from '../../../services/backend';
|
|
|
import { BoardOptionsCell } from './BoardOptionsCell';
|
|
|
import { BoardDateCell } from './BoardDateCell';
|
|
|
import { BoardTextCell } from './BoardTextCell';
|
|
@@ -17,23 +15,28 @@ export const BoardCell = ({
|
|
|
cellCache: CellCache;
|
|
|
fieldController: FieldController;
|
|
|
}) => {
|
|
|
- const { loadCell, data } = useCell(cellIdentifier, cellCache, fieldController);
|
|
|
- useEffect(() => {
|
|
|
- void (async () => {
|
|
|
- await loadCell();
|
|
|
- })();
|
|
|
- }, []);
|
|
|
-
|
|
|
return (
|
|
|
<>
|
|
|
{cellIdentifier.fieldType === FieldType.SingleSelect ||
|
|
|
cellIdentifier.fieldType === FieldType.MultiSelect ||
|
|
|
cellIdentifier.fieldType === FieldType.Checklist ? (
|
|
|
- <BoardOptionsCell value={data as SelectOptionCellDataPB | undefined}></BoardOptionsCell>
|
|
|
+ <BoardOptionsCell
|
|
|
+ cellIdentifier={cellIdentifier}
|
|
|
+ cellCache={cellCache}
|
|
|
+ fieldController={fieldController}
|
|
|
+ ></BoardOptionsCell>
|
|
|
) : cellIdentifier.fieldType === FieldType.DateTime ? (
|
|
|
- <BoardDateCell value={data as DateCellDataPB | undefined}></BoardDateCell>
|
|
|
+ <BoardDateCell
|
|
|
+ cellIdentifier={cellIdentifier}
|
|
|
+ cellCache={cellCache}
|
|
|
+ fieldController={fieldController}
|
|
|
+ ></BoardDateCell>
|
|
|
) : (
|
|
|
- <BoardTextCell value={data as string | undefined}></BoardTextCell>
|
|
|
+ <BoardTextCell
|
|
|
+ cellIdentifier={cellIdentifier}
|
|
|
+ cellCache={cellCache}
|
|
|
+ fieldController={fieldController}
|
|
|
+ ></BoardTextCell>
|
|
|
)}
|
|
|
</>
|
|
|
);
|