import * as api from "../service/SharedService";
import { useQuery } from "@tanstack/react-query";
import { useSharedStore } from "../store/sharedStore";

export const useGetMe = () => {
  const { isLogin } = useSharedStore();
  return useQuery({
    queryKey: ["me"],
    queryFn: api.getMe,
    enabled: isLogin,
    retry: false,
  });
};
