"use strict";

exports.__esModule = true;
exports.useKanbanCollectionSyncProps = useKanbanCollectionSyncProps;
var _react = require("react");
var _useToolbarCollectionSyncProps = require("../ToolbarCollection/useToolbarCollectionSyncProps");
var _isValidElement = require("../isValidElement");
function useKanbanCollectionSyncProps(props) {
  const {
    state: kanban,
    dataExtension
  } = props;
  const state = kanban.toolbar;
  (0, _useToolbarCollectionSyncProps.useToolbarCollectionSyncProps)({
    ...props,
    state,
    isUsingDragAndDrop: false,
    isUsingBulkActionsToolbar: false,
    isUsingHorizontalScroll: false,
    isUsingFolders: false,
    isUsingTableVirtualization: false
  });
  (0, _react.useState)(() => {
    if ((0, _isValidElement.isValidElement)(dataExtension)) {
      dataExtension.type.setDataExtensionOnTable(state, dataExtension.props);
    } else {
      dataExtension == null || dataExtension.setDataExtensionOnTable(state);
    }
  });
  (0, _react.useEffect)(() => {
    if (!dataExtension) {
      return;
    }
    ((0, _isValidElement.isValidElement)(dataExtension) ? dataExtension.type : dataExtension).syncTableCollectionProps(state);
  }, []);
  return state;
}
//# sourceMappingURL=useKanbanCollectionSyncProps.js.map