import { useFocusEffect } from '@react-navigation/native';
import { useAppStore } from '@/src/store/appStore';

export const useHideTabNav = (caller: string = 'default') => {
  const setHideTabsNavKey = useAppStore((state) => state.setHideTabsNavKey);

  useFocusEffect(() => {
    setHideTabsNavKey(caller, true); // Hide tabs when screen focuses

    return () => {
      setHideTabsNavKey(caller, false); // Show tabs when screen blurs
    };
  });
};