"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _reactNative = require("react-native");
var _elements = require("../../../../../elements");
var _native = require("@react-navigation/native");
var _styles = require("./styles");
var _BackButton = _interopRequireDefault(require("../../../../../elements/BackButton"));
var _reactNativeSvg = require("react-native-svg");
var _icons = require("../../../../../../core/assets/icons");
var _BehaviourProvider = require("../../../../../providers/BehaviourProvider");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function Header({
  onAddMember
}) {
  const {
    styles,
    theme
  } = (0, _styles.useStyles)();
  const navigation = (0, _native.useNavigation)();
  const {
    AmityCommunityMembershipPageBehavior
  } = (0, _BehaviourProvider.useBehaviour)();
  return /*#__PURE__*/React.createElement(_reactNative.View, {
    style: styles.container
  }, /*#__PURE__*/React.createElement(_BackButton.default, {
    onPress: navigation.goBack
  }), /*#__PURE__*/React.createElement(_elements.Title, {
    numberOfLines: 1,
    ellipsizeMode: "tail",
    style: styles.title
  }, "All members"), onAddMember ? /*#__PURE__*/React.createElement(_reactNative.TouchableOpacity, {
    onPress: () => {
      if (AmityCommunityMembershipPageBehavior.goToAddMemberPage) {
        return AmityCommunityMembershipPageBehavior.goToAddMemberPage({
          users: [],
          onAddedAction: onAddMember
        });
      }
      navigation.navigate('CommunityAddMember', {
        users: [],
        onAddedAction: onAddMember
      });
    }
  }, /*#__PURE__*/React.createElement(_reactNativeSvg.SvgXml, {
    xml: (0, _icons.plus)(),
    width: 24,
    height: 24,
    color: theme.colors.base
  })) : /*#__PURE__*/React.createElement(_reactNative.View, {
    style: styles.dummy
  }));
}
var _default = exports.default = Header;
//# sourceMappingURL=Header.js.map