import { checkUserExists } from "@/lib/api/auth/user-exists"
import { useQueryClient } from "@tanstack/react-query"

export const useCheckUserExistsLazy = () => {
  const queryClient = useQueryClient()

  const run = (phone: string) =>
    queryClient.fetchQuery({
      queryKey: ['checkUserExists', phone],
      queryFn: () => checkUserExists({ phone }),
    })

  return { run }
}
