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

import { wwwAPI } from "@/utilities/wwwAPI";
import { GetCommentaryAPI } from "@/type/wwwAPI";

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