import { API_ENDPOINTS } from "@/lib/api";
import { feedbackService } from "@/lib/api/services/feedback-service";
import { useQuery } from "@tanstack/react-query";
import { useMemo } from "react";

export const useGetFeedSingleFeedback = (id: string) => {
  const queryKey = useMemo(() => [API_ENDPOINTS.FEEDBACK.DETAILS(id)], [id]);
  return useQuery({
    queryKey,
    queryFn: () => feedbackService.getSingleFeedback(id),
  });
};
export const useGetFeedback = (params: Record<string, any>) => {
  const queryKey = useMemo(
    () => [API_ENDPOINTS.FEEDBACK.READ_ALL, params],
    [params],
  );
  return useQuery({
    queryKey,
    queryFn: () => feedbackService.getFeedbacks(params),
  });
};
