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

import { wwwAXIOS } from "src/Www";
import { GetCommentaryAPI } from "src/wwwAPI";

export default function useGetCommentary() {
  return useQuery({
    queryKey: ["commentary"],
    queryFn: async () => {
      const { data } = await wwwAXIOS.get<GetCommentaryAPI>("/commentary");
      return data;
    },
    initialData: [],
  });
}
