"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Action = Action;
var _postTargetType = require("../../../../../enums/postTargetType");
var _icons = require("../../../../../../core/assets/icons");
var _bottomSheetSlice = require("../../../../../../core/stores/slices/bottomSheetSlice");
var _components = require("../../../../../components");
var _MenuAction = _interopRequireDefault(require("../../../../../elements/MenuAction"));
var _BehaviourProvider = require("../../../../../providers/BehaviourProvider");
var _types = require("../../../../../types");
var _native = require("@react-navigation/native");
var _useAuth = _interopRequireDefault(require("../../../../../../core/hooks/useAuth"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function Action({
  userId
}) {
  const {
    openBottomSheet,
    closeBottomSheet
  } = (0, _bottomSheetSlice.useBottomSheet)();
  const {
    AmityUserProfilePageBehavior
  } = (0, _BehaviourProvider.useBehaviour)();
  const navigation = (0, _native.useNavigation)();
  const {
    client
  } = (0, _useAuth.default)();
  if ((client === null || client === void 0 ? void 0 : client.userId) !== userId) return null;
  return /*#__PURE__*/React.createElement(_components.FloatingActionButton, {
    onPress: () => {
      openBottomSheet({
        height: 240,
        content: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_MenuAction.default, {
          gap: "small",
          label: "Post",
          iconProps: {
            xml: (0, _icons.post)()
          },
          onPress: () => {
            closeBottomSheet();
            if (AmityUserProfilePageBehavior !== null && AmityUserProfilePageBehavior !== void 0 && AmityUserProfilePageBehavior.goToPostComposerPage) {
              var _AmityUserProfilePage;
              AmityUserProfilePageBehavior === null || AmityUserProfilePageBehavior === void 0 || (_AmityUserProfilePage = AmityUserProfilePageBehavior.goToPostComposerPage) === null || _AmityUserProfilePage === void 0 || _AmityUserProfilePage.call(AmityUserProfilePageBehavior, {
                mode: _types.AmityPostComposerMode.CREATE,
                targetId: userId,
                targetType: _postTargetType.PostTargetType.user
              });
            } else {
              navigation.navigate('CreatePost', {
                mode: _types.AmityPostComposerMode.CREATE,
                targetId: userId,
                targetType: _postTargetType.PostTargetType.user
              });
            }
          }
        }), /*#__PURE__*/React.createElement(_MenuAction.default, {
          gap: "small",
          label: "Poll",
          iconProps: {
            xml: (0, _icons.poll)()
          },
          onPress: () => {
            closeBottomSheet();
            if (AmityUserProfilePageBehavior !== null && AmityUserProfilePageBehavior !== void 0 && AmityUserProfilePageBehavior.goToPollPostComposerPage) {
              var _AmityUserProfilePage2;
              AmityUserProfilePageBehavior === null || AmityUserProfilePageBehavior === void 0 || (_AmityUserProfilePage2 = AmityUserProfilePageBehavior.goToPollPostComposerPage) === null || _AmityUserProfilePage2 === void 0 || _AmityUserProfilePage2.call(AmityUserProfilePageBehavior, {
                targetId: userId,
                targetType: 'user'
              });
            } else {
              navigation.navigate('PollPostComposer', {
                targetId: userId,
                targetType: _postTargetType.PostTargetType.user
              });
            }
          }
        }), /*#__PURE__*/React.createElement(_MenuAction.default, {
          gap: "small",
          label: "Livestream",
          iconProps: {
            xml: (0, _icons.livestream)()
          },
          onPress: () => {
            closeBottomSheet();
            if (AmityUserProfilePageBehavior !== null && AmityUserProfilePageBehavior !== void 0 && AmityUserProfilePageBehavior.goToCreateLivestreamPage) {
              var _AmityUserProfilePage3;
              AmityUserProfilePageBehavior === null || AmityUserProfilePageBehavior === void 0 || (_AmityUserProfilePage3 = AmityUserProfilePageBehavior.goToCreateLivestreamPage) === null || _AmityUserProfilePage3 === void 0 || _AmityUserProfilePage3.call(AmityUserProfilePageBehavior, {
                targetId: userId,
                targetType: 'user',
                targetName: 'My timeline'
              });
            } else {
              navigation.navigate('CreateLivestream', {
                targetId: userId,
                targetType: _postTargetType.PostTargetType.user,
                targetName: 'My timeline'
              });
            }
          }
        }))
      });
    }
  });
}
//# sourceMappingURL=Action.js.map