"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = require("react");
var _enums = require("../../../../enums");
var _hooks = require("../../../../hooks");
var _CommunitySearchResult = _interopRequireDefault(require("../../../../components/CommunitySearchResult/CommunitySearchResult"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const AmityCommunitySearchResultComponent = ({
  searchResult,
  onNextPage,
  pageId = _enums.PageID.WildCardPage
}) => {
  const componentId = _enums.ComponentID.community_search_result;
  const {
    isExcluded
  } = (0, _hooks.useAmityComponent)({
    pageId,
    componentId
  });
  if (isExcluded) return null;
  if (!(searchResult !== null && searchResult !== void 0 && searchResult.length)) return null;
  return /*#__PURE__*/React.createElement(_CommunitySearchResult.default, {
    pageId: pageId,
    componentId: componentId,
    communities: searchResult,
    onNextPage: onNextPage
  });
};
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(AmityCommunitySearchResultComponent);
//# sourceMappingURL=CommunitySearchResult.js.map