import { ElementID, PageID } from '../../../../../enums';
import { Alert, View } from 'react-native';
import { Title } from '../../../../../elements';
import { useNavigation } from '@react-navigation/native';
import { useStyles } from './styles';
import BackButton from '../../../../../elements/BackButton';
function Header({
  isFormDirty
}) {
  const {
    styles
  } = useStyles();
  const navigation = useNavigation();
  return /*#__PURE__*/React.createElement(View, {
    style: styles.container
  }, /*#__PURE__*/React.createElement(BackButton, {
    pageId: PageID.community_setup_page,
    onPress: () => {
      if (!isFormDirty) return navigation.goBack();
      Alert.alert('Leave without finishing?', 'Your changes that you made may not be saved.', [{
        text: 'Cancel',
        style: 'cancel'
      }, {
        text: 'Leave',
        style: 'destructive',
        onPress: navigation.goBack
      }]);
    }
  }), /*#__PURE__*/React.createElement(Title, {
    pageId: PageID.community_setup_page,
    elementId: ElementID.community_edit_title
  }), /*#__PURE__*/React.createElement(View, {
    style: styles.dummy
  }));
}
export default Header;
//# sourceMappingURL=Header.js.map