import { useQuery } from "@tanstack/react-query";
import { wwwAXIOS } from "src/Www";
import { GetCommentAPI } from "src/wwwAPI";

export default function useGetComment(essayID: string) {
  return useQuery({
    queryKey: ["comment", essayID],
    queryFn: async () => {
      const { data } = await wwwAXIOS.get<GetCommentAPI>(`/comment/${essayID}`);
      return data;
    },
    initialData: [],
  });
}
