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

export const useGetUsers = (page: number = 1, limit: number = 10) => {
  const { search } = useSharedStore();
  return useQuery({
    queryKey: ["users", page, limit, search],
    queryFn: () => api.getUsers(page, limit, search),
  });
};
