BoardCell.tsx 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { CellIdentifier } from '../../stores/effects/database/cell/cell_bd_svc';
  2. import { CellCache } from '../../stores/effects/database/cell/cell_cache';
  3. import { FieldController } from '../../stores/effects/database/field/field_controller';
  4. import { FieldType } from '../../../services/backend';
  5. import { BoardOptionsCell } from './BoardOptionsCell';
  6. import { BoardDateCell } from './BoardDateCell';
  7. import { BoardTextCell } from './BoardTextCell';
  8. export const BoardCell = ({
  9. cellIdentifier,
  10. cellCache,
  11. fieldController,
  12. }: {
  13. cellIdentifier: CellIdentifier;
  14. cellCache: CellCache;
  15. fieldController: FieldController;
  16. }) => {
  17. return (
  18. <>
  19. {cellIdentifier.fieldType === FieldType.SingleSelect ||
  20. cellIdentifier.fieldType === FieldType.MultiSelect ||
  21. cellIdentifier.fieldType === FieldType.Checklist ? (
  22. <BoardOptionsCell
  23. cellIdentifier={cellIdentifier}
  24. cellCache={cellCache}
  25. fieldController={fieldController}
  26. ></BoardOptionsCell>
  27. ) : cellIdentifier.fieldType === FieldType.DateTime ? (
  28. <BoardDateCell
  29. cellIdentifier={cellIdentifier}
  30. cellCache={cellCache}
  31. fieldController={fieldController}
  32. ></BoardDateCell>
  33. ) : (
  34. <BoardTextCell
  35. cellIdentifier={cellIdentifier}
  36. cellCache={cellCache}
  37. fieldController={fieldController}
  38. ></BoardTextCell>
  39. )}
  40. </>
  41. );
  42. };