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