import { PageID } from '../../../../../enums';
import { Alert, View } from 'react-native';
import { Title, CloseButton } from '../../../../../elements';
import { useNavigation } from '@react-navigation/native';
import { useStyles } from './styles';
function Header({
  isFormDirty
}) {
  const {
    styles
  } = useStyles();
  const navigation = useNavigation();
  return /*#__PURE__*/React.createElement(View, {
    style: styles.container
  }, /*#__PURE__*/React.createElement(CloseButton, {
    pageId: PageID.community_setup_page,
    onPress: () => {
      if (!isFormDirty) return navigation.goBack();
      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(Title, {
    pageId: PageID.community_setup_page
  }), /*#__PURE__*/React.createElement(View, {
    style: styles.dummy
  }));
}
export default Header;
//# sourceMappingURL=Header.js.map