import { TouchableOpacity, View } from 'react-native';
import { Title } from '../../../../../elements';
import { useNavigation } from '@react-navigation/native';
import { useStyles } from './styles';
import BackButton from '../../../../../elements/BackButton';
import { SvgXml } from 'react-native-svg';
import { plus } from '../../../../../../core/assets/icons';
import { useBehaviour } from '../../../../../providers/BehaviourProvider';
function Header({
  onAddMember
}) {
  const {
    styles,
    theme
  } = useStyles();
  const navigation = useNavigation();
  const {
    AmityCommunityMembershipPageBehavior
  } = useBehaviour();
  return /*#__PURE__*/React.createElement(View, {
    style: styles.container
  }, /*#__PURE__*/React.createElement(BackButton, {
    onPress: navigation.goBack
  }), /*#__PURE__*/React.createElement(Title, {
    numberOfLines: 1,
    ellipsizeMode: "tail",
    style: styles.title
  }, "All members"), onAddMember ? /*#__PURE__*/React.createElement(TouchableOpacity, {
    onPress: () => {
      if (AmityCommunityMembershipPageBehavior.goToAddMemberPage) {
        return AmityCommunityMembershipPageBehavior.goToAddMemberPage({
          users: [],
          onAddedAction: onAddMember
        });
      }
      navigation.navigate('CommunityAddMember', {
        users: [],
        onAddedAction: onAddMember
      });
    }
  }, /*#__PURE__*/React.createElement(SvgXml, {
    xml: plus(),
    width: 24,
    height: 24,
    color: theme.colors.base
  })) : /*#__PURE__*/React.createElement(View, {
    style: styles.dummy
  }));
}
export default Header;
//# sourceMappingURL=Header.js.map