"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useTopBar = useTopBar;
var _styles = require("../styles");
var _hooks = require("../../../../../../hooks");
var _enums = require("../../../../../../enums");
var _native = require("@react-navigation/native");
function useTopBar({
  inline
}) {
  const pageId = _enums.PageID.user_profile_page;
  const {
    styles
  } = (0, _styles.useStyles)();
  const navigation = (0, _native.useNavigation)();
  const {
    accessibilityId: backButtonId
  } = (0, _hooks.useAmityElement)({
    pageId,
    componentId: _enums.ComponentID.WildCardComponent,
    elementId: _enums.ElementID.back_button
  });
  const handleGoBack = () => {
    const routes = navigation.getState().routes;
    if (inline && routes.length === 1) {
      navigation.navigate('AmitySocialHomePage');
    } else {
      navigation.goBack();
    }
  };
  return {
    styles,
    handleGoBack,
    backButtonId
  };
}
//# sourceMappingURL=useTopBar.js.map