import { useStyles } from '../styles';
import { useAmityElement } from '../../../../../../hooks';
import { ComponentID, ElementID, PageID } from '../../../../../../enums';
import { useNavigation } from '@react-navigation/native';
export function useTopBar({
  inline
}) {
  const pageId = PageID.user_profile_page;
  const {
    styles
  } = useStyles();
  const navigation = useNavigation();
  const {
    accessibilityId: backButtonId
  } = useAmityElement({
    pageId,
    componentId: ComponentID.WildCardComponent,
    elementId: 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