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

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

export default function useGetLatestComment() {
  return useQuery({
    queryKey: ["latestComment"],
    queryFn: async () => {
      const { data } =
        await wwwAXIOS.get<GetLatestCommentAPI>("/comment/latest");
      return data;
    },
    initialData: [],
  });
}
