import { GetLatestCommentAPI } from "@/type/wwwAPI";

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

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