"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _reactNative = require("react-native");
var _react = require("react");
var _enums = require("../../../../../enums");
var _useConfig = _interopRequireDefault(require("../../../../../hooks/useConfig"));
var _hooks = require("../../../../../hooks");
var _styles = require("./styles/styles");
var _BehaviourProvider = require("../../../../../providers/BehaviourProvider");
var _native = require("@react-navigation/native");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const CreateCommunityButton = () => {
  const {
    excludes
  } = (0, _useConfig.default)();
  const styles = (0, _styles.useStyles)();
  const navigation = (0, _native.useNavigation)();
  const {
    AmityEmptyNewsFeedComponent
  } = (0, _BehaviourProvider.useBehaviour)();
  const [text] = (0, _hooks.useUiKitConfig)({
    keys: ['text'],
    page: _enums.PageID.social_home_page,
    component: _enums.ComponentID.empty_newsfeed,
    element: _enums.ElementID.create_community_button
  });
  const onPressCreateCommunity = (0, _react.useCallback)(() => {
    if (AmityEmptyNewsFeedComponent.onPressCreateCommunity) return AmityEmptyNewsFeedComponent.onPressCreateCommunity();
    navigation.navigate('CreateCommunity');
  }, [AmityEmptyNewsFeedComponent, navigation]);
  if (excludes.includes('social_home_page/empty_newsfeed/create_community_button')) return null;
  return /*#__PURE__*/React.createElement(_reactNative.Text, {
    style: styles.createCommunityBtnText,
    onPress: onPressCreateCommunity
  }, text ?? 'Create Community');
};
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(CreateCommunityButton);
//# sourceMappingURL=CreateCommunityButton.js.map