import { memo } from 'react';
import { ComponentID, PageID } from '../../../../enums';
import { useAmityComponent } from '../../../../hooks';
import CommunitySearchResult from '../../../../components/CommunitySearchResult/CommunitySearchResult';
const AmityCommunitySearchResultComponent = ({
  searchResult,
  onNextPage,
  pageId = PageID.WildCardPage
}) => {
  const componentId = ComponentID.community_search_result;
  const {
    isExcluded
  } = useAmityComponent({
    pageId,
    componentId
  });
  if (isExcluded) return null;
  if (!(searchResult !== null && searchResult !== void 0 && searchResult.length)) return null;
  return /*#__PURE__*/React.createElement(CommunitySearchResult, {
    pageId: pageId,
    componentId: componentId,
    communities: searchResult,
    onNextPage: onNextPage
  });
};
export default /*#__PURE__*/memo(AmityCommunitySearchResultComponent);
//# sourceMappingURL=CommunitySearchResult.js.map