import { queryOptions } from "@tanstack/react-query";
import axios from "axios";

export function getServerStats() {
	return queryOptions({
		queryKey: ["getServerStats"],
		queryFn: () => fetchSession(),
		staleTime: 2 * 60 * 1000,
		refetchOnWindowFocus: true,
	});
}

const fetchSession = async () => {
	const { data } = await axios.get(`/lst/api/system/allservers/stats`);

	return data;
};
