import { Server } from "../types/Server.ts";
import api from "../utils/api.ts";
import { useQuery } from "@tanstack/react-query";

export default function useQueryServers() {
  return useQuery({
    queryKey: ["servers"],
    queryFn: () => api.get("servers").json<Server[]>(),
  });
}
