"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _enums = require("../../../../../enums");
var _reactNative = require("react-native");
var _elements = require("../../../../../elements");
var _native = require("@react-navigation/native");
var _styles = require("./styles");
function Header({
  isFormDirty
}) {
  const {
    styles
  } = (0, _styles.useStyles)();
  const navigation = (0, _native.useNavigation)();
  return /*#__PURE__*/React.createElement(_reactNative.View, {
    style: styles.container
  }, /*#__PURE__*/React.createElement(_elements.CloseButton, {
    pageId: _enums.PageID.community_setup_page,
    onPress: () => {
      if (!isFormDirty) return navigation.goBack();
      _reactNative.Alert.alert('Leave without finishing?', "Your progress won't be saved and your community won't be created.", [{
        text: 'Cancel',
        style: 'cancel'
      }, {
        text: 'Leave',
        style: 'destructive',
        onPress: navigation.goBack
      }]);
    }
  }), /*#__PURE__*/React.createElement(_elements.Title, {
    pageId: _enums.PageID.community_setup_page
  }), /*#__PURE__*/React.createElement(_reactNative.View, {
    style: styles.dummy
  }));
}
var _default = exports.default = Header;
//# sourceMappingURL=Header.js.map