import React from 'react';
import { PageID } from '../../../enums';
import { useBehaviour } from '../../../providers/BehaviourProvider';
import { useNavigation } from '@react-navigation/native';
import TargetSelectionPage from '../../../components/TargetSelectionPage/TargetSelectionPage';
const AmityPollTargetSelectionPage = () => {
  const {
    AmityPollTargetSelectionPageBehavior
  } = useBehaviour();
  const navigation = useNavigation();
  const onSelectFeed = ({
    targetId,
    targetType,
    targetName,
    community
  }) => {
    const context = {
      pop: 2,
      targetId,
      targetType,
      community,
      targetName
    };
    if (AmityPollTargetSelectionPageBehavior.goToPollPostComposerPage) {
      return AmityPollTargetSelectionPageBehavior.goToPollPostComposerPage(context);
    }
    navigation.navigate('PollPostComposer', context);
  };
  const onClickClose = () => {
    if (AmityPollTargetSelectionPageBehavior !== null && AmityPollTargetSelectionPageBehavior !== void 0 && AmityPollTargetSelectionPageBehavior.onClickClose) {
      AmityPollTargetSelectionPageBehavior.onClickClose();
    }
  };
  return /*#__PURE__*/React.createElement(TargetSelectionPage, {
    onSelectFeed: onSelectFeed,
    pageId: PageID.select_poll_target_page,
    onClickClose: onClickClose
  });
};
export default /*#__PURE__*/React.memo(AmityPollTargetSelectionPage);
//# sourceMappingURL=TargetSelection.js.map