"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _enums = require("../../../enums");
var _BehaviourProvider = require("../../../providers/BehaviourProvider");
var _native = require("@react-navigation/native");
var _TargetSelectionPage = _interopRequireDefault(require("../../../components/TargetSelectionPage/TargetSelectionPage"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const AmityStoryTargetSelectionPage = () => {
  const {
    AmityStoryTargetSelectionPageBehavior
  } = (0, _BehaviourProvider.useBehaviour)();
  const navigation = (0, _native.useNavigation)();
  const onSelectFeed = ({
    targetId,
    targetType
  }) => {
    if (AmityStoryTargetSelectionPageBehavior.goToStoryComposerPage) {
      return AmityStoryTargetSelectionPageBehavior.goToStoryComposerPage({
        targetId,
        targetType
      });
    }
    navigation.navigate('CreateStory', {
      targetId,
      targetType
    });
  };
  const onClickClose = () => {
    if (AmityStoryTargetSelectionPageBehavior !== null && AmityStoryTargetSelectionPageBehavior !== void 0 && AmityStoryTargetSelectionPageBehavior.onClickClose) {
      AmityStoryTargetSelectionPageBehavior.onClickClose();
    }
  };
  return /*#__PURE__*/_react.default.createElement(_TargetSelectionPage.default, {
    pageId: _enums.PageID.select_story_target_page,
    onSelectFeed: onSelectFeed,
    hideMyTimelineTarget: true,
    onClickClose: onClickClose
  });
};
var _default = exports.default = /*#__PURE__*/_react.default.memo(AmityStoryTargetSelectionPage);
//# sourceMappingURL=TargetSelection.js.map