import { useCallback } from 'react';
import { useRecoilValue } from 'recoil';
import { utagConfig as utagAtom } from "../../../atoms/tracking/index.js";
import { trackView } from "../../../utils/tracking/index.js";
const useTrackView = function useTrackView() {
  const config = useRecoilValue(utagAtom);
  return useCallback(view => {
    if (!config) return;
    trackView({
      ...config,
      page_name: view
    });
  }, [config]);
};
export default useTrackView;