import { useMutation, useQuery } from "@tanstack/react-query";
import * as api from "../service/Service";

export const useGetProduct = (id: string) => {
  return useQuery({
    queryKey: ["product", id],
    queryFn: () => api.getProduct(id),
  });
};

export const useToggleFavorite = () => {
  return useMutation({
    mutationFn: api.toggleFavorite,
  });
};
