import { ItemDTO, User } from "@/shared/dto/user/usersDto";
import { getArchivedUserId, OrgQueryParams } from "@/shared/services/organizationsService";
import { useQuery } from "@tanstack/react-query";

export const useArchivedUsers = (UnitId: string,params?:OrgQueryParams) => {
  return useQuery({
    queryKey: ["archived-users", UnitId,params],
    queryFn: async () => {
      if (!UnitId) return { items: [], count: 0 };
      const { data } = await getArchivedUserId(UnitId,params);
      return data as { items: ItemDTO[]; count: number };
    },
    enabled: !!UnitId,
  });
};
