"use strict";

exports.__esModule = true;
exports.useIsCollectionToolbarExists = void 0;
const useIsCollectionToolbarExists = (props, {
  excludeSearch = false,
  isMobile
} = {}) => {
  var _state$collectionData, _state$tagsCollection;
  const {
    title,
    tabs,
    views,
    customColumns,
    multiLevelSorting,
    search,
    filters,
    tableGridSwitchButton,
    exportButton,
    primaryActionButton,
    secondaryActions,
    moreActions,
    state
  } = props;
  const hasExplicitFeatures = !!(!isMobile && title || tabs || views || customColumns || multiLevelSorting || exportButton || primaryActionButton || secondaryActions || moreActions || tableGridSwitchButton || filters);
  if (hasExplicitFeatures) {
    return true;
  }
  if (!excludeSearch && search !== false) {
    return true;
  }
  const hasDynamicFilters = (((_state$collectionData = state.collectionDataExtension) == null ? void 0 : _state$collectionData.buildCustomFieldFilters()) || []).length > 0 || !!((_state$tagsCollection = state.tagsCollectionState) != null && _state$tagsCollection.buildTagsFilterWrapper());
  return hasDynamicFilters;
};
exports.useIsCollectionToolbarExists = useIsCollectionToolbarExists;
//# sourceMappingURL=useIsCollectionToolbarExists.js.map